9 In a function definition fun that is designed to receive a

9. In a function definition fun that is designed to receive as an argument the address of the beginning of a two-dimensional array of doubles, with 7 rows and 5 columns, and we need to use array notation inside the function to access array elements, which of the following function prototypes are acceptable to the compiler? Select ALL appropriate responses.

a. void fun(double arr[7][5], int rows, int cols);

b. void fun(double arr[][5], int rows, int cols);

c. void fun(double arr[7][], int rows, int cols);

d. void fun(double arr[][], int rows, int cols);

e. void fun(double arr, int rows, int cols);

Solution

The right answer is

a. void fun(double arr[7][5], int rows, int cols);

Here the size of the row is 7 and the size of the column is 5.

Array is of type double and rows and columns are of type int.

9. In a function definition fun that is designed to receive as an argument the address of the beginning of a two-dimensional array of doubles, with 7 rows and 5

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site