Assigned Reading:
Slides As Shown:
Topics Covered:
Programs Shown:
Examples of the Box class using virtual identify(). The only change needed is to add the keyword "virtual" to declaration of identify() in the Box class definition: Box.h.
Some test programs using the virtual identify() function: vtest0.cpp, vtest1.cpp, and vtest2.cpp. Note that the end of vtest2.cpp is a total hack that rewrites the virtual function table pointer of cc to make it point to the base class virtual function table. (Don't do try this at home.)