August 2001
Beginner
482 pages
10h 52m
English
In this hour, you learned how to use virtual member functions to enable your derived classes to behave polymorphically with their base classes.
In classes with virtual methods, the destructor should almost always be made virtual. A virtual destructor ensures that the derived part of the object will be freed when delete is called on the pointer. Constructors cannot be virtual. Virtual copy constructors can be effectively created by making a virtual member function that calls the copy constructor.
Read now
Unlock full access