how to use new with 2d vector in c++ code example
Example 1: 2d vector c++ declaration
vector< vector<int>> a(rows, vector<int> (cols));
Example 2: how to make a 2d vector in c++
// Create a vector containing n
//vectors of size m, all u=initialized with 0
vector<vector<int> > vec( n , vector<int> (m, 0));