/******************************************************************************************** *** FILE: virtual_methods.cpp *** DATE: 03/01/2004 *** AUTHOR: Daniel Dementiev *** GOAL: This is an example program for IST482 class. It illustrates how we can use *** dynamic binding by soecifying methods as virtual. ********************************************************************************************/ #include #include using namespace std; class Person { protected: string name; public: Person() : name("unknown") {}; Person(char *n) : name(n) {}; virtual void Print() const { cout<<"Person::Print(): "<Print(); // calling Student::Print() cout<PrintAll(); // calling Student::PrintAll() } /********************************************************************************************/