Inheritance Example
class employee {
char *name;
int age;
int department;
int salary;
// for a linked list
employee *next;
};
class manager {
// employee data
employee emp;
// linked list of underlings
employee *group;
// managerial level
int level;
};
Basic Definition of an Employee:
class manager : employee {
// linked list of underlings
employee *group;
// managerial level
int level;
};
Previous slide
Next slide
Back to first slide
View graphic version