//Base class declaration
class Person {
public:
const string& NameIs() const;
void change_name(const string& n);
void write_info() const;
private:
string name;
};
//Derivate class declaration
class Employee : public Person {
public:
Employee() : salary(0) {}
longint earn() const;
change_salary( longint new_salary );
void write_info() const;
private:
longint salary;
};
"A derived class inherits all data members from the base class ... This means that an object of the class Employee has the data members name and salary."
Then it shows a nice little picture of ugly rectangles where an object of the Person class has "name" whereas an object of the Employee class has "name" and "salary".
So I try to access a private member from a subclass and it says "error: within this context" and that it's a private member.