At this point we need to incorporate the constructors and the destructor into the class and method definitions. Given the significance of adding constructors, we’ll advance the name from
stock10.h. The class methods go into a file called
stock10.cpp. Finally, we place the program using these resources in a third file,
Listing 10.4 shows the header file for the stock program. It adds prototypes for the constructor and destructor functions to the original class declaration. Also it dispenses with the
acquire() function, which is no longer necessary now that the class has constructors. The file also uses the
#ifndef technique described in Chapter 9 to protect against multiple inclusion ...