map find function

i have map like this
1=>5
2=>1
3=>2
4=>3
5=>1
now if i use find func. like this
it=mymap.find(2)
then it will point
2=>1 or 3=> 2 as both contain 2 in first and second position!

http://en.cppreference.com/w/cpp/container/map/find
reference wrote:
Finds an element with key key
So your example will return pair (2, 1)
Last edited on
Topic archived. No new replies allowed.