Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - virtual destructors http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   Virtual Destructors
   Destructors  can be declared as virtual. If the destructor in  a  base
   class  is  declared  as virtual then the  destructor  in  every  class
   derived  from it is also virtual. Virtual destructors ensure that  the
   correct destructor is invoked when delete is used to destroy an object
   of a derived class that has been allocated with new and assigned to  a
   base  class  pointer.  This is necessary because  the  object  may  be
   addressed by a pointer which is of a base class type.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson