Declaration
1 2 3 4 5 6 7 |
vector<int> v; // Size of 100 and initialize all to 0 vector<int> v(100, 0) // Reserve size of 3, to prevent extra complexity for copying v.reserve(3); |
Simple operation
1 2 |
int n; v.push_back(n); |
Fill with something
1 |
fill(v.begin(), v.end(), 101); |
Combine two vectors…