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; }
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; }