I want to iterate through each element in the map without knowing any of its string-int values or keys.
What I have so far:
The value_type of a map is a pair containing the key and value as it's first and second member, respectively.
map::iterator it;
for (it = symbolTable.begin(); it != symbolTable.end(); it++)
{
std::cout << it->first << ' ' << it->second << '\n';
}
Or with C++11, using range-based for:
for (auto const& p : symbolTable)
{
std::cout << p.first << ' ' << p.second << '\n';
}