Answers for "how to change the value of a key in hashmp in c++"

C++
0

how to change the value of a key in hashmp in c++

std::map<char, int> m;
m.insert(std::make_pair('c', 0));  // c is for cookie

std::map<char, int>::iterator it = m.find('c'); 
if (it != m.end())
    it->second = 42;
Posted by: Guest on August-26-2021

Code answers related to "how to change the value of a key in hashmp in c++"

Browse Popular Code Answers by Language