| Create two sets of base and derived classes. These classes don't need to be useful or represent anything in particular so no data members necessary. For all classes set up constructors which simply output a message that tells which class's constructor is being called. Also set up destructors for all classes that indicate which class's destructor is being called. For one base class and derive class set do not make the destructors virtual. For these other set, do make the destructors virtual. Write a driver that demonstrates the effects of non-virtual destructors vs. virtual destructors by using a pointer to a base class object. Dynamically allocate an instance of each class and then destroy it taking note to the messages output. |
|
|
|
|
|
|