Question: Here's main.cpp. I need DynamicArray.h: #include #include #include #include DynamicArray.h using namespace std; // Sample class, to show a template can work with anything class


Here's main.cpp. I need DynamicArray.h:
#include
// Sample class, to show a template can work with anything class Hero { string name_; int hitpoints_; int maxHP_; public: Hero() {} Hero(const char *name, int hp, int maxHP) { name_ = name; hitpoints_ = hp; maxHP_ = maxHP; } void SetName(const char *name) { name_ = name; } string GetName() { return name_; } friend ostream &operator
void TestOne(); void TestTwo(); void TestThree(); void TestFour();
int main() { cout
void TestOne() { cout data(0); cout
cout data2(10); cout
for (int i = 0; i
for (unsigned int i = 0; i
cout
cout
for (unsigned int i = 0; i
cout data3;
data3.Add(100); data3.Add(999); data3.Add(200); data3.Add(300); data3.Add(400);
for (unsigned int i = 0; i
cout
for (unsigned int i = 0; i
cout
cout
} void TestFour() { DynamicArray for (unsigned int i = 0; i DynamicArray cout Description All programs need storage of some kind as they execute. Arrays are the most basic, and probably the most common form of storage. However, because of their fixed nature they can be problematic to use, particularly if you need to store data of varying lengths as your application's needs change over time. One of the first data structures people start to use in any programming language is some form of an expandable array. Java has the ArrayList class, C# has the List class, and even C++ has the vector
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
