Answers for "c++ map key exists"

C++
20

check if key exists in map c++

if ( m.find("f") == m.end() ) {
  // not found
} else {
  // found
}
Posted by: Guest on April-22-2020
0

c++ map key exists

if ( !(myMap.find("key") == myMap.end()) ) {	// "key" exists	
  
} else {	// not found	
  
}
Posted by: Guest on January-20-2021

Browse Popular Code Answers by Language