Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<Test*> v;
- Test *x = new Test(55,35);
- for(int i=0; i<10; i++){
- if(i == 5)
- v.push_back(x);
- else
- v.push_back(new Test(i, i*2));
- }
- printVector(v);
- delete x;
- x = NULL;
- printVector(v);
Advertisement
Add Comment
Please, Sign In to add comment