Courses/CS 2124/Lab Manual/Pointers and Dynamic Memory/Homework
An “Elastic” Array
In lab, you created a
DynamicArray class that allows an array of any size to be created at runtime. The class used the concept of RAII by utilizing a destructor to ensure that the dynamically-allocated internal storage array was properly deleted when it left memory.
In this exercise, you will begin working on an
ElasticArray that will use dynamic allocation instead of static allocation to store the internal array attribute. Later, you can update it to be able to grow or shrink on demand (much like