key exist in map c++ code example
Example 1: check if key exists in map c++
if ( m.find("f") == m.end() ) {
// not found
} else {
// found
}
Example 2: check if a key is in map c++
if ( m.find("f") == m.end() ) {
// not found
} else {
// found
}