Array is a collection of similar data type which occupies continuous location on memory. Array’s name is a constant pointer which point first element of array. So when an array is passing to a function. Address of first element pass to function instead of value. If any change made inside of function body with array, then it affects actual value of passed array. Following program demonstrate this fact.
printf("\nBefore function call\ Array Data\n");
printf("\nAfter function call\ Array Data\n");
int update(int ar)
In given program array is initialed with 1 to 5 respectively. For loop is used to print array value before and after function call you will notice in output that every value of array is incremented by 5 after function call. This is done inside of update function body that effect array’s actual data. So given example is a demo for sake of that array is passing by reference to a function.