- default constructor
- copy constructor
- initializing constructor
The first one is pretty simple:
The second one is also a famous type of constructor:
vector<int> x;With it, you can copy the contents of another vector. In the example above, you'll get a new vector y, whose contents is copied from vector x.
vector<int> y(x.begin(), x.end());
cout << y[i] << endl;
The last but not least is the initializing constructor. Literally you can initialize vectors at the same time as declaring them.
vector<int> x(10, 0);
You're creating a vector whose value is composed of 10 zeros.