I have the following map in c++
std::map<string,int> mymap;
after inserting several values into it I then want to be able to search for a value in the map. I can use the find function to accomplish this
std::cout << "a => " << mymap.find("a")->second << '\n';
The problem with this is that find returns 0 when I search for a key that doesn't exist. I may want to insert a key with a value of 0 but I also need to know if a certain key does not exist in the map. Is there any way to accomplish this?