#include #include using namespace std; void main(){ vector vp; //vector v; for(int i = 0; i < 5; i++){ // int *p = new int(i)); // vp.push_back(p); // or in one line: vp.push_back(new int(i)); // v.push_back(*(new int(i)); stupid } vector::reverse_iterator it; for(it = vp.rbegin(); it != vp.rend(); it++){ cout << *it << endl; cout << **it << endl; } for(int j = 0; j < 5; j++) delete vp[j]; }