How to resize a vector of vector containing integer values.
std::vector<std::vecotr<int>> MyVector;
int value = 10;
//need to insert values as 2 rows and 3 columns, like
//Myvector[0][0] = value;
//Myvector[0][1] = value;
//Myvector[0][2] = value;
//Myvector[1][0] = value;
//Myvector[1][1] = value;
//Myvector[1][2] = value;
// ......
//here i have to resize the vector size to 4 rows and 5 cols using resize() function.
MyVector.resize(.......); //Hoe is this possible.
The first problem is , I have to insert the values as 2 rows and 3 columns. how can I use push_back function for this purpose. After that need to resize to the specified size. Since it a vector of vector I am getting worried about this.
You can think of a vector of vectors as a matrix where the member vectors are “rows”.