Question: Modify the header and the source files. Add a member function void allocate(int s) which allows you to change the size of the array. Make

Modify the header and the source files. Add a member function voidModify the header and the source files. Add a member function void allocate(int s) which allows you to change the size of the array. Make sure that memory is not leaked.Modify the header file and the source files again, so that it works for two dimensional array where all the rows are the same size. The user will specify the number of rows and columns as well as the content of the array, which you will take as input from user in the main function.

Labiepat - Adobe Acrobat Reader DC (32-bit) File Edit Vice Sign Window Help Home Tools Lab02.pdf Sign In + 150- dynarr.h dynarr. CPP #ifndef DYNARR_H_INCLUDED #define DYNARR H INCLUDED class dynarr #include "dynarr.h" #inelude using namespace std; DO private: int *data; int size; public: dynArr(); dynArr(int); dynArr(); void setvalue (int, int); int getValue (int); 2 o #endif // DYNARR_H_INCLUDED 2 dynArr::dynArro 1 data - NULL; size = 0; ) dynArr::dynArr(int s) { data = new int[s]; size = 3; } dynArr::-dynArr() 1 1 delele [] dala; ) int dynArr::getValue (int index) 1 return data[index]; } void dynArr::setValue(int index, int value) 1 data[index] = value; ) Tasks: + Type here to search O A4 3:25 PM V11/2001

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!