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* createArray(int n, int elemSize); In this function, programmers need to creates an array with length (n+3) like below: Size of array Min value (float) Max value (float) Element 1 (arr[0]) Element n (arr[n-1]) (int) The minimum value in this array needs to be stored at the very beginning of this memory chunk as a floating-point number, followed by the maximum value in this array as another floating-point number. The size of the array is then stored after them as an integer number. These three numbers should not be visible to users. 2. int getArraySize(void * array) This function receives an array of any type, and returns the size of the array. 3. void store Min Max(void * array) This function receives an array of any type, then searches the min and max values among all elements and stores them at the corresponding locations as two floating-point numbers as described in 1. 4. void freeArray(void* array) This function receives an array of any type, then frees ALL the memories that have been allocated. 5. A calling function (main function) also needs to be completed, which creates a float array using the first function, then populates the array with any float numbers you prefer, then searches and stores the min, max values using the 3rd function. At last it prints out the desired information and frees all the allocated memories. Example output: Elements in array are: 6.20, 7.20, 8.20, 9.20, 10.20, 11.20, 12.20, 13.20, 14.20, 15.20 Array size is 10, min value is 6.20, and max value is 15.20

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!