Hello Programmers,
In a C++ map, is there any way to search for the key given a content? Example:
I have this map:
map<int,string> myMap;
myMap[0] = "foo";
Is there any way that I can find the corresponding int, given the value "foo"?
cout << myMap.some_function("foo") <<endl;
Output: 0
Cheers!!!
Thanks to @Cubbi and @Peter87 !!!
Your responses were very helpful.
Cheers!