// File: typer.C // // Separately compiled typer function #include #include #include #include "person3.h" void typer (Person *) ; void typer (Person *ptr) { cout << typeid(*ptr).name() << endl ; if (typeid(*ptr) == typeid(Person)) { cout << "ptr is pointing to a Person" << endl ; } else if ( typeid(*ptr) == typeid(Student)) { cout << "ptr is pointing to a Student" << endl ; } else if ( typeid(*ptr) == typeid(Faculty)) { cout << "ptr is pointing to a Faculty" << endl ; } else { cout << "ptr is pointing to something else" << endl ; } }