std::map

Hi, all!

I have declared a map, which includes an int value and a two-dimensional vector, also:
std::map<int, vector < vector <int> > > mymap;

I want to use an iterator to point to a cell from my vector.
std::map<int, vector < vector <int> > >::iterator it;

After that I know that with the command it->second, I point to the whole vector, but how to point to a cell in the vector?

Best regards!
it->second[0] ? :)
No.Isn't so simple :D The programm crashed. I have tried many times.
With:
1
2
3
std::map<int, vector < vector <int> > > mymap;
// ...
std::map<int, vector < vector <int> > >::iterator it = mymap.begin() ;


it->second => vector < vector <int> > // 2D

it->second[0] => vector<int> // row 0

it->second[0][0] => int // cell 0,0
Thank you a lot, JLBorges! It works with your help! :) Have a nice evening!
Topic archived. No new replies allowed.