Question: 6. I15 points] Below is a class called pointer DataClass that store data in a one- dimensional array using pointer. # include iostream using namespace
6. I15 points] Below is a class called pointer DataClass that store data in a one- dimensional array using pointer. # include iostream using namespace std; class pointerDataclass int maxSize;//variable to store the maximum size of p int length;//variable to store the number of elements in p int "p;// pointer to an int array public: /constructor to create an array of the size specified by the parameter size. pointerDataClass(int size); //Destructor t -pointerDataclass ); //the function insertAt inserts num into array p at the position specified by //index void insertAt(int index, int num); //The function displayData displays all the array elements in p void displayData() pointerDataClass. Assume the class declaration, class implementation and main function are stored in the same file. Implement (write code) all constructors, functions, and the destructor a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
