#include #include using namespace std; void main() { vector v(10,'z'); // create a vector with 10 copies of 'z' cout << "First element of initial sequence resided at address: " << hex << reinterpret_cast(v.begin()) << endl; cout << "Contents of initial sequence: " << endl; for (int i = 0; i < v.size(); i++) { cout << v[i] << " "; } cout << endl; v.reserve(20); // expand capacity to 20 elements cout << "First element of expanded sequence resides at address: " << hex << reinterpret_cast(v.begin()) << endl; v.assign(v.capacity(),'a'); // delete contents of v and replace with 20 copies of 'a' cout << "Contents of expanded sequence: " << endl; for (int j = 0; j < v.size(); j++) { cout << v[j] << " "; } cout << endl; }