| Defaul666 (7) | |
|
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! | |
|
|
|
| strongdrink (456) | |
| it->second[0] ? :) | |
|
|
|
| Defaul666 (7) | |
| No.Isn't so simple :D The programm crashed. I have tried many times. | |
|
|
|
| JLBorges (1756) | |||
With:
it->second => vector < vector <int> > // 2D it->second[0] => vector<int> // row 0 it->second[0][0] => int // cell 0,0 | |||
|
|
|||
| Defaul666 (7) | |
| Thank you a lot, JLBorges! It works with your help! :) Have a nice evening! | |
|
|
|