previous | start | next

## Derived Classes

- All member functions and data members of the base class are automatically inherited by the derived class.

  >     Manager m;
  >     m.set_salary(68000);

- In the derived class definition you specify only new member functions and data members.

  >     class Manager : public Employee
  >     {
  >     public:
  >        Manager(string name, double salary, string dept);
  >        string get_department() const;
  >     private:
  >        string department;
  >     };

- The class diagram below shows the relationship between derived classes. The arrow with a hollow head indicates inheritance.

previous | start | next