#include <iostream> // cout #include <algorithm> // copy_backward #include <vector> // vector using namespace std; int main () { vector<int> myvector; // set some values: for (int i=1; i<=5; i++) myvector.push_back(i*10); // myvector: 10 20 30 40 50 myvector.resize(myvector.size()+3); // allocate space for 3 more elements copy_backward ( myvector.begin()+1, myvector.begin()+3, myvector.end() ); cout << "myvector contains:"; for (vector<int>::iterator it=myvector.begin(); it!=myvector.end(); ++it) cout << ' ' << *it; cout << '\n'; return 0; }