how to check if element is present 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
}