title: What do I need to do before deleting elements in a vector of pointers to dynamically allocated objects?
body: <p>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:</p>
  
  <ol>
  <li>Is it true that when I am done with the vector, I must loop through it and call delete on each pointer?</li>
  <li>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?</li>
  <li>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)?</li>
  </ol>