how to resize vectors vector?

Dec 31, 2008 at 4:38pm
So somewhere, I got this code:

vector<vector<int> > items;

but how do i resize it, for example to items[5][5]?
Dec 31, 2008 at 11:27pm
First you need to resize the outer vector, and then each of its elements.
Jan 1, 2009 at 2:35am
If you use push_back it will resize itself......this is the advantage of vectors over arrays
Jan 1, 2009 at 2:59am
vectors have also a resize function ( http://www.cplusplus.com/reference/stl/vector/resize.html )
Last edited on Jan 1, 2009 at 2:59am
Topic archived. No new replies allowed.