Answers for "check if a word is in map c++"

C++
-1

check if a word is in map c++

std::string key = "toto";

std::map<std::string, int> rule = {
	{ "input" , 1 },
    { "output", 2 },
    { "all"   , 3 }
};

if (rule.count(key) == 0) {
	std::cout << key << " not Found" << std::endl;
}
Posted by: Guest on February-27-2022

Code answers related to "check if a word is in map c++"

Browse Popular Code Answers by Language