Question: Use C++ 2. (Array Class Template) (50 points) Based on the IntArray class given as below, design a single class template named Array that works
2. (Array Class Template) (50 points) Based on the IntArray class given as below, design a single class template named Array that works with any primitive data type. Demonstrate the class template by creating four Array objects of integers, floats, chars and strings. Pass arguments to the constructor when you create an object. Then call the print0 member function to display the array elements of the four objects. class IntArray ( public: IntArray(int t, int): void pcint); private: int *ptC int size; 1i IntArrayaIntArray(int arcli, int s) ptr = new int[s]; size = s; for(int i-0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
