Question: Language: C++ I need help creating a class called DynamicArray and its purpose is to store an array that uses the concept of templates to
Language: C++
I need help creating a class called DynamicArray and its purpose is to store an array that uses the concept of templates to store any type of data. It needs accessors: unsigned int GetCapacity() const; , unsigned int GetSize() const; , const T * GetData() const; , const T &operator[](unsigned int index) const; , T & operator [](unsigned int index); , const T &At(unsigned int index) const; , and T &At(unsigned int index); It also needs mutators void Add(const T &data); , which adds item to end of array if there's room, void Resize(unsigned int newSize); , which resizes the array if there's not enough room, and void Remove(unsigned int index); , which removes element from array and shrinks array to the gap. It also needs constructors, assignment operators, and destructor. All of this is suppose to be in a header file DynamcArray.h
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
