Multiple choice

How can an array be passed as a function argument?

  1. By value

  2. By reference

  3. By name

  4. By passing all the values stored in the array

  5. The array cannot be used as a function argument

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

While passing arrays to the argument, the name of the array is passed as an argument, i.e, starting address of memory area is passed as argument. Hence, an array is passed by reference.