jweinst1
9/7/2016 - 11:11 PM

check to see if key is in un_ordered map

check to see if key is in un_ordered map

#include <iostream>
#include <string>
#include <unordered_map>
//small example in C++ using unordered_map
typedef std::unordered_map<std::string, int> dict;

int main() {
	dict x;
	std::string a = "妈";
	x[a] = 3;
	x["日"] = 5;
    if(x.find("妈") != x.end()) std::cout << 3 << std::endl;
    else std::cout << 4;
    //3
}