1//vector<vector<int>> M;
2//int m = number of rows, n = number of columns;
3M.resize(m, vector<int>(n));
1 myVector.resize(row_count, vector<int>(column_count, initialization_value));
2//Example1: create a 2D integer vector with 5 rows and 5 columns having "1"
3 myVector.resize(5, vector<int>(5, 1));
4//Ex2
5 myVector.resize(n);
6 for (int i = 0; i < n; ++i)
7 myVector[i].resize(m);
8