#include #include #include using namespace std; int main() { const int a[] = {10, 21, 30}; const size_t n = sizeof a / sizeof a[0]; vector v(a, a + n); cout << "size == " << v.size() << ", capacity == " << v.capacity() << "\n"; vector::iterator it = v.begin() + 1; //Refer to the 21. *it = 20; //Overwrite the 21. cout << "size == " << v.size() << ", capacity == " << v.capacity() << "\n"; for (it = v.begin(); it != v.end(); ++it) { cout << *it << "\n"; } return EXIT_SUCCESS; }