I have a vector that I fill with pointers to objects. I am trying to learn good memory management, and have a few general questions:

  1. Is it true that when I am done with the vector, I must loop through it and call delete on each pointer?
  2. Why don't I have to call delete on the vector or any other variable I declare without the new statement, but delete must be called on pointers?
  3. Does C++ handle freeing the pointers' memory for me if the vector is declared in a function which returns (causing the vector to go out of scope)?
Edit
Report