Multiple choice

Array passed as an argument to a function is interpreted as

  1. address of the number of elements of the array

  2. values of the first elements of the array

  3. address of the first element of the array

  4. number of elements of the array

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

When an array is passed as an argument to a function, it 'decays' into a pointer to its first element. The function receives the memory address of element [0], not a copy of all elements or the count. This is why array parameters are often accompanied by a separate size parameter - the pointer alone doesn't convey array length.