#include class Name { public: Name(void) { myName = 0; } ~Name(void) { delete[] myName; } void SetName(char* n) { myName = new char[strlen(n)+1]; strcpy(myName,n); } void Print(void) { cout << myName << endl; } private: char* myName; }; class Contact: public Name { public: Contact(void) { myAddress = 0; } ~Contact(void) { delete[] myAddress; } void SetAddress(char* c) { myAddress = new char[strlen(c)+1]; strcpy(myAddress,c); } void Print(void) { Name::Print(); cout << myAddress << endl; } private: char* myAddress; }; int main(void) { Contact c; c.SetName("Shuchi Kulkarni"); c.SetAddress("SAL 339, University of Southern California"); c.Print(); }