




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















class Parent { public: void Func1(); void Func1(int); };
class Child: public Parent { public: void Func1(); };
class Person{
public:
void Walk();
};
class ParalyzedPerson: public Person{
public:
void Walk();
};
**class Person{ char *name; public: Person(char =NULL); const char GetName() const; void Print(){ cout << “Name: ” << name << endl; } }; Docsity.com
class Student : public Person{ char * major; public: Student(char * aName, char aMajor);*
void Print(){ cout <<“Name: ”<< GetName()<<endl << “Major:” << major<< endl; } ... };
Output:
Name: Ahmed
Major: Computer Science
int main(){
Student a(“Ahmad”, “Computer Science”); a.Print(); return 0;
}
int main(){
Student a(“Ahmad”, “Computer Science”); a.Print(); return 0;
}
Output:
Name: Ahmed
Major: Computer Science