Quantcast
Viewing all articles
Browse latest Browse all 16

Answer by Andreas Bonini for How to find if a given key exists in a std::map

You can use .find():

map<string,string>::iterator i = m.find("f");if (i == m.end()) { /* Not found */ }else { /* Found, i->first is f, i->second is ++-- */ }

Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>