Passing Array to Function in C/CPP

Arrays are passed by reference... The function gets a pointer to the array. That means the function has no way of knowing the dimensions of the array. Unless the array size is fixed, you would pass the number of elements as a separate argument.

1 Like