9. In a function definition fun that is designed to receive as an argument the a
ID: 3930872 • Letter: 9
Question
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);
Explanation / Answer
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.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.