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;