Modify
the
Handle.h,
Handle.cpp,
and
UseHandle.cpp
files
at the end of Chapter 5 to use constructors and destructors.
Create
a class with a destructor and nondefault constructor, each of which print
something to announce their presence. Write code that demonstrates when the
constructor and destructor are called.
Demonstrate
automatic counting and aggregate initialization with an array of objects of the
class you created in Exercise 2. Add a member function to that class that
prints a message. Calculate the size of the array and move through it, calling
your new member function.
Create
a class without any constructors, and show you can create objects with the
default constructor. Now create a nondefault constructor (one with an argument)
for the class, and try compiling again. Explain what happened.