1// Create a vector containing n
2//vectors of size m, all u=initialized with 0
3vector<vector<int> > vec( n , vector<int> (m, 0));
1myVector[
2 Vector[0, 4, 2, 5],
3 Vector[1, 4, 2]
4];
5
6/*When you call for myVector[1].size() it would return 3 and [0] would return 4.
7
8For the amount of rows (int vectors) in the 2d vector, you can just use myVector.size()
9
10You can run this to see it in actions*/
1// Initializing 2D vector "vect" with
2// values
3vector<vector<int> > vect{ { 1, 2, 3 },
4 { 4, 5, 6 },
5 { 7, 8, 9 } };