Special Classes and Functions 535
15
- Using the program from Exercise 1, write a short driver program that makes three
objects and then displays their member variables and the static member variable.
Then destroy each object and show the effect on the static member variable. - Modify the program from Exercise 2 to use a static member function to access the
static member variable. Make the static member variable private. - Write a pointer to member function to access the nonstatic member data in the pro-
gram in Exercise 3, and use that pointer to print the value of that data. - Add two more member variables to the class from the previous exercises. Add
accessor functions that get the value of this data and give all the member functions
the same return values and signatures. Use the pointer to member function to
access these functions.