Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

unordered_map contains key

// declare a unordered_map (or even a normal map wouuld work)
unordered_map<char, char> mapping;
mapping['a'] = 'z';

// check if 'a' is present as key using find method
if(mapping.find('a') != m.end()){
  cout << "a is a key in mapping!
";
}
 
PREVIOUS NEXT
Tagged: #key
ADD COMMENT
Topic
Name
8+2 =