// Do it yourself Run Time Type Identification // All objects here are of class A,B, or C. // A pointer to an object of class Identified Type is able to // find out what kind of object it is pointing at. #include class Identified_Type { public: virtual int type()=0; void print(){ cout << this->type() <type() << endl; p=&b; cout << p->type() << endl; p=&c; cout << p->type() << endl; a.print(); b.print(); c.print(); p=&a; p->print(); p=&b; p->print(); p=&c; p->print(); return 0; }