Quantcast
Viewing latest article 12
Browse Latest Browse All 16

Answer by aJ. for How to find if a given key exists in a std::map

m.find == m.end() // not found 

If you want to use other API, then find go for m.count(c)>0

 if (m.count("f")>0)      cout << " is an element of m.\n";    else       cout << " is not an element of m.\n";

Viewing latest article 12
Browse Latest Browse All 16

Trending Articles