hello,
could someone explain me if I have to delete the first element of pvec and how many manner (syntax way) I have to do it?

thanks:
Qt Code:
  1. vector<int*>* pvec = new vector<int*>();
  2. int ten=10, twenty=20, thirty=30;
  3. int* pten = new int(10);
  4. int* ptwenty = &twenty;
  5. int* pthirty = &thirty;
  6.  
  7. pvec->push_back(pten);
  8. pvec->push_back(ptwenty);
  9. pvec->push_back(pthirty);
  10. vector<int*>::iterator it;
  11.  
  12. for(it=pvec->begin(); it != pvec->end(); ++it) {
  13. cout << "*it " << *(*it) << " ";
  14. }
  15. delete (*pvec)[0]; //necessary or not? how many way to do it?
  16. delete pvec;
To copy to clipboard, switch view to plain text mode