Add element to two demension Vector with no fixed size.
My question is very easy if this vector has a fixed size. for example:
Code:
vector< vector<int> > matrix(5,vector<int>(5,0));
matrix[4][4]=2;
matrix[3][2]=1;
But that is not obvious when you don't fixed size for vector. You cannot use push_back like one demension array. This is my example:
Code:
vector< vector<int> >matrix;
vector<int> array;
array.push_back(5); //OK
matrix.push_back(5); //NOT OK. So How can.
So, that's my problem. Who know how to code it, help me please.
thanks for ton :)