I have a vector< vector< pair<int,int> > > and I want to print all its values
I tried doing this with 2 iterators, but failed miserably on the 2nd one:
vector< vector< pair<int, int> > > list;
vector< vector< pair<int, int> > >::iterator it1;
vector< pair<int, int> >::iterator it2;
for( it1=list.begin(); it1<list.end(); ++it1 ){
for( it2=it1.begin(); it2<it1.end(); ++it2 ){
printf("%d, %d", *it2.first, *it2.second);
}
}
any ideas on how to traverse the second vector as well?
Thanks
maybe you meant something like this: