Check out example codes for "resize two dimensional vector c++". It will help you in understanding the concepts better.

Code Example 1

//vector<vector<int>> M;
//int m = number of rows, n = number of columns;
M.resize(m, vector<int>(n));

Learn ReactJs, React Native from akashmittal.com