Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C programing language: Consider the following declarations of a function that re

ID: 655109 • Letter: C

Question

C programing language:

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 ____.

Question 4 options:

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)

Explanation / Answer

B) only if the function is declared as in (ii)