... Fig. 9.29, count is referenced by both line 18 in the constructor and line 27 in the destructor.

Fig. 9.28 Employee class definition with a static data member to track the number of Employee objects in memory.

Alternate View

 1   // Fig. 9.28: Employee.h
 2   // Employee class definition with a static data member to
 3   // track the number of Employee objects in memory
 4   #ifndef EMPLOYEE_H
 5   #define EMPLOYEE_H
 6
 7   #include <string>
 8
 9   class Employee {
10   public:
11      Employee(const std::string&, const std::string&); // constructor
12      ~Employee(); // destructor
13      std::string getFirstName() const; // return first name
14      std::string getLastName() const

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.