how to initialize all ements in 2d vector in c++ code example
Example 1: initialzing a 2d vector in cpp
// Create a vector containing n row and m columns
vector<vector<int> > vec( n , vector<int> (m, 0));
Example 2: initialise 2d vector in c++
// Initializing 2D vector "vect" with
// values
vector<vector<int> > vect{ { 1, 2, 3 },
{ 4, 5, 6 },
{ 7, 8, 9 } };