initialzing a 2d vector in cpp 1

initialzing a 2d vector in cpp

  // Create a vector containing n row and m columns
  vector > vec( n , vector (m, 0));  

Here is what the above code is Doing:
1. Create a vector of size n.
2. Fill the vector with m number of zeros.
3. Repeat step 1 and 2 n number of times.

Similar Posts