First page Back Continue Last page Overview Graphics
“Get next”/for iterator in C++
std::map<string, int> m;
std::map<string, int>::iterator it;
m["Fred"] = 5;
m["Bob"] = 3;
for (it = m.begin(); it != m.end(); ++it)
{
std::cout << it->first << “:” << it->second << std::endl;
}