Programming Challenge 3
Description
Create a class wrapping around a dynamically sized array of integers. Use RAII
to manage the class. In this first case, do not use smart pointers or data
structures from the standard library. Then, make a second version of your class
that uses std::unique_ptr
. Provide methods for adding data,
removing data, and accessing data. Write a simple test program to verify
accuracy.
Details
- Name the files and program
classic_dyn_int_array.h/cpp
,
modern_dyn_int_array.h/cpp
and test.cpp
,
respectively.
- In your top file comment, please reflect on this exercise. Briefly state
how your refactoring simplified the implementation.