1. Engineering
  2. Computer Science
  3. c program the functions create and free a dynamically allocated...

Question: c program the functions create and free a dynamically allocated...

Question details

C PROGRAM

the functions create and free a dynamically allocated 2D array. It should function like a statically allocated array (use malloc())

int **createArray(int rows, int cols)

parameters to this function are the number of rows and cols in the array. The return value is the array that you have dynamically allocated

void freeArray (int **array, int rows, int cols)

the parameters to this function are:

-the array created by createArray()

-the number of rows in the array

-the number of cols in the array

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution