Question: code in c please Objectives: Pointer arithmetic, type casting, call by reference. Requirements: In this lab, five functions need to be implemented using the following

code in c pleasecode in c please Objectives: Pointer arithmetic, type casting, call by reference.

Objectives: Pointer arithmetic, type casting, call by reference. Requirements: In this lab, five functions need to be implemented using the following function prototypes: 1. void ** create2DArray(int numRows, int numCols, int elemSize); In this function, programmers need to create a 2D array like below: Num of Rows Num of Cols Num of Cols T[0][0] T[1][0] T[0][1] T [1][1] T[O][num Cols-1] T[1][num Cols-1] Num of Cols T[num Rows-1][0] T[numRows-1][1] ... T[numRows-1][num Cols-1] The number of rows needs to be stored before the array of row pointers as a double- precision number (double), and the number of columns needs to be stored before each row also as a double-precision number (double). These numbers should not be visible to users. 2. double getRowSize(void ** table); This function receives a 2D array of any type, and returns the number of rows in this 2D array, which is stored before row pointers. 3. double getColSize(void** table, int rowNo); This function receives a 2D array of any type, then returns the number of columns in the row that indicated by input variable "rowNo", or returns "-1" if the indicated row doesn't exist. "rowNo" is 0-based. 4. void printTable(void** table); This function receives a 2D array of any type and prints out all the values in this 2D array in row- wise order. In this section, all elements in the 2D array are integers. 5. void free Table(void** table); This function receives the 2D array, and frees ALL the previously allocated memories. Note: You can create your own testing (main) function in whichever way you prefer to test your functions. Your main function will NOT be graded in this lab. Objectives: Pointer arithmetic, type casting, call by reference. Requirements: In this lab, five functions need to be implemented using the following function prototypes: 1. void ** create2DArray(int numRows, int numCols, int elemSize); In this function, programmers need to create a 2D array like below: Num of Rows Num of Cols Num of Cols T[0][0] T[1][0] T[0][1] T [1][1] T[O][num Cols-1] T[1][num Cols-1] Num of Cols T[num Rows-1][0] T[numRows-1][1] ... T[numRows-1][num Cols-1] The number of rows needs to be stored before the array of row pointers as a double- precision number (double), and the number of columns needs to be stored before each row also as a double-precision number (double). These numbers should not be visible to users. 2. double getRowSize(void ** table); This function receives a 2D array of any type, and returns the number of rows in this 2D array, which is stored before row pointers. 3. double getColSize(void** table, int rowNo); This function receives a 2D array of any type, then returns the number of columns in the row that indicated by input variable "rowNo", or returns "-1" if the indicated row doesn't exist. "rowNo" is 0-based. 4. void printTable(void** table); This function receives a 2D array of any type and prints out all the values in this 2D array in row- wise order. In this section, all elements in the 2D array are integers. 5. void free Table(void** table); This function receives the 2D array, and frees ALL the previously allocated memories. Note: You can create your own testing (main) function in whichever way you prefer to test your functions. Your main function will NOT be graded in this lab

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!