previous | start | next

## Automatic Memory Management

- For this discussion, we will use a modification of the Department class that was introduced earlier.

  >     class Department
  >     {
  >        ...
  >     private:
  >        string name;
  >        Employee* receptionist;
  >     };

  >     Department::Department(string n, Employee)
  >     {
  >        name = n;
  >        receptionist = new Employee(e.get_name(), e.get_salary());
  >     }

  >     /* second constructor */

  >     Department::Department(string n)
  >     {
  >        name = n;
  >        receptionist = NULL;
  >     }

previous | start | next