I have a problem iterating over the second map in a map.
#include <map>
using namespace std;
map<string, map<string, string> > mymap;
map<string, map<string, string> >::iterator itm;
pair<map<string, map<string, string> >::iterator,bool> retm;
for( itm=mymap.begin(); itm!=mymap.end(); ++itm)
{
cout << "first:\t" << it->first << endl;
}
How can I iterate over the second map and get both first and second keys/values?
And the second question is, how can I “insert” into the first and second map using the “insert” function that comes with maps?
I hope someone has a full answer.
1 Answer