// File: main1.C // // Testing the Person class #include #include #include "person.h" void foo(Person &p) ; void bar(Person *p) ; void foo(Person &p) { cout << "Name: " << p.name << endl ; cout << "Age: " << p.age << endl ; cout << endl ; } void bar(Person *p) { cout << "Name: " << p->name << endl ; cout << "Age: " << p->age << endl ; cout << endl ; } int main() { Person X("John Smith", 30) ; Student S("Joe Blow", 19, 2, 3.79) ; Faculty F("Dr. Foo", 45, 17) ; cout << "Calling foo():" << endl ; foo(X) ; foo(S) ; foo(F) ; cout << "\nCalling bar():" << endl ; bar(&X) ; bar(&S) ; bar(&F) ; }