C++ Notes: Programming Exercises - Extend CheckedArray

Base Program

Use one of the following for the base program for these changes.


  1. The CheckedArray class dynamically allocates memory, but never deallocates it. Fix this memory leak by writing a destructor.
  2. When a CheckedArray parameter is passed, the default copy constructor will only make a shallow copy. Write a copy constructor to make a deep copy.
  3. Shallow copies are also made by the assignment operator by default. Overload the assignment operator to make a deep copy.