So somewhere, I got this code:
vector<vector<int> > items;
but how do i resize it, for example to items[5][5]?
First you need to resize the outer vector, and then each of its elements.
If you use push_back it will resize itself......this is the advantage of vectors over arrays
Last edited on