Which of the following are correct syntaxes to send an array as a parameter to function:
Answer: B
Correct answer: func(array);
An array name in an expression decays to a pointer to its first element, so passing the name is all that is required and the function receives that pointer. &array gives a pointer to the whole array, a different type; *array passes the first element rather than the array; and array[size] passes one element, and one that is out of bounds at that.
Please log in or register to report this question.