Solved

Consider the Following Declarations of a Function That Receives an Array

Question 18

Multiple Choice

Consider the following declarations of a function that receives an array of integers and finds the element with the maximum value:
(i) findMax(int *vals, int numEls)
(ii) findMax(int vals[], int numEls)
The address in vals may be modified ____.


A) only if the function is declared as in (i)
B) only if the function is declared as in (ii)
C) if either (i) or (ii) is used
D) in neither case because an array variable cannot be modified (it is a pointer constant)

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions