Z
zl2k
hi, there
Suppose I have declared a vector in the header file
vector<int> v1;
vector< vector<int> > v2;
Now I need to reinitialize the vector somewhere later to different
sizes. How can I do that for v2? For v1, I can always say
v1.assign(10,0);
to set its size to 10 and populate with 0s.
For v2, can I reinitialize it with known size of one dimension (row)
and with unknown size of another dimension (collumn)? How? (Or maybe I
can always declare the unknow size to 1 since the vector can grow?)
Thanks ahead.
zl2k
Suppose I have declared a vector in the header file
vector<int> v1;
vector< vector<int> > v2;
Now I need to reinitialize the vector somewhere later to different
sizes. How can I do that for v2? For v1, I can always say
v1.assign(10,0);
to set its size to 10 and populate with 0s.
For v2, can I reinitialize it with known size of one dimension (row)
and with unknown size of another dimension (collumn)? How? (Or maybe I
can always declare the unknow size to 1 since the vector can grow?)
Thanks ahead.
zl2k