Create a template class for creating and manipulating one dimensional arrays.
You will need to create:
We will need the member functions:
addElement() isempty() isfull() getCapacity() //actual size of the array getUsed() //number of elements currently in the array removeElement().
Let the remove function overwrite the element to be removed with the last element in the array, so that there are no ‘holes’ in the used portion of the array. An empty array and an array with one element are special cases for the remove member function.
You do not have to make the array resizable.
You can declare the array data field as:
T *a;
You will need to overload the operators [], which accesses and changes elements in the array, and = which assigns “other” array to “this” array.
Since the array is not held within the object, you will also need a destructor.
Create an application that demonstrates the functions you wrote.