int *pointer; // random value, w/e was in therepointer = new int(5); // I FILL the pointer with a memory address pointing to an interger with the value 5delete pointer;pointer = NULL; // I fill the pointer with w/e NULL holds
I can't think of a better name really...
Quote:Original post by CaspianB
You can enter 1 or 2. At compile time, the code doesn't know which variable obj will be allocated to when it calls delete. Nor does it care. It's handled at run time. This is even the case if you don't use virtual methods. However, to ensure your destructor is run for your derived class (and any other methods you may choose to override in the derived class that are in the base class), you need to be virtual.
Ah, I see your point, but how does it safe that information at run-time? At a special memory place?