Is there a way to initialize a vector of vectors in the same ,quick, manner as you initialize a matrix?
typedef int type;
type matrix[2][2]=
{
{1,0},{0,1}
If the matrix is completely filled -
vector< vector > TwoDVec(ROWS, vector(COLS));
//Returns a matrix of dimensions ROWS*COLS with all elements as 0
//Initialize as -
TwoDVec[0][0] = 0;
TwoDVec[0][1] = 1;
..
.
Update : I found there's a better way here
else if there are variable number of elements in each row(not a matrix) -
vector< vector > TwoDVec(ROWS);
for(int i=0; i