... 12      ~CreateAndDestroy(); // destructor
13   private:
14      int objectID; // ID number for object
15      sdt::string message; // message describing object
16   };
17
18   #endif

Fig. 9.9 CreateAndDestroy class member-function definitions.

Alternate View

 1   // Fig. 9.9: CreateAndDestroy.cpp
 2   // CreateAndDestroy class member-function definitions.
 3   #include <iostream>
 4   #include "CreateAndDestroy.h"// include CreateAndDestroy class definition
 5   using namespace std;
 6
 7   // constructor sets object's ID number and descriptive message
 8   CreateAndDestroy::CreateAndDestroy(int ID, string messageString)
 9      : objectID{ID}, message{messageString} {
10      cout << "Object ...

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.