# Defining and initializing vectors
vector<T> v1; // vector that holds object of type T, default constructor v1 is empty
vector<T> v2 (v1); // v2 is a copy of v1
vector<T> v3(n, i); // v2 has n elements with value i
vector<T> v4(n); // v4 has n copies of a value-initialized object
# The size of a vector
vector<int>::size_type
vector<int> v;
for (vector<int>::size_type ix = 0; ix != 10; ++ix) {
// v[ix] = ix; // wrong
v.push_back(ix);
}
# Iterator
vector<int> v(10, 1);
for (vector<int>::iterator iter = v.begin(); iter != v.end(); ++iter) {
cout << *iter << endl;
}