1#include <iostream>
2#include <vector>
3using namespace std;
4
5int main()
6{
7 vector<vector<int> > buff;
8
9 for(int i = 0; i < 10; i++)
10 {
11 vector<int> temp; // create an array, don't work directly on buff yet.
12 for(int j = 0; j < 10; j++)
13 temp.push_back(i);
14
15 buff.push_back(temp); // Store the array in the buffer
16 }
17
18 for(int i = 0; i < buff.size(); ++i)
19 {
20 for(int j = 0; j < buff[i].size(); ++j)
21 cout << buff[i][j];
22 cout << endl;
23 }
24
25 return 0;
26}
1// Initializing vector with values
2 vector<int> vect1{1, 2, 3, 4};
3
4 // Declaring another vector
5 vector<int> vect2;
6
7 // Copying vector by assign function
8 vect2.assign(vect1.begin(), vect1.end());