Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ hash map key count

#include <unordered_map>
#include <iostream>

unordered_map<int,int> hashMap;
hashMap[1] = 3;
hashMap[2] = 4;
if(hashMap.count(1) {
	std::cout << "true" << std::endl;		
}
   
std::cout << std::boolalpha << (hashMap.count(3) ? true : false) << std::endl;
 
 
PREVIOUS NEXT
Tagged: #hash #map #key #count
ADD COMMENT
Topic
Name
6+3 =