Hi, I have a vector that I fill with pointers to objects. I am trying to learn good memory management. I have a few general questions:
Is it true that when I am done with the vector I must loop through it and call delete on each pointer?
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?
Does c++ handle freeing the pointers' memory for me if the vector is declared in a function which returns (the vector goes out of scope)?
Thanks!