Friday, November 24, 2023

if an array is used as a function argument the array is passed by...........


Answer: by reference

When an array (variable) is passed as a function argument, it passes the base address of the array. The base address is the location of the first element of the array in the memory.

When a function receives the array pointer, it can then access all of the elements in the array by using pointer arithmetic and dereferencing

No comments:

Post a Comment