Given this base class:
class Employee
{
char* name;
int age;
public:
Employee(char* name);
void print();
};
With reg
In C++, inheritance is private by default. However, to any code using the Manager class, there appears to be almost no difference, since they have the same methods.
You won't be able to cast the Manager object to an Employee, though. You also won't be able to access the employees
variable from within the Manager class.