calling function called function main(void func(int *numprintf("% "*num)int arr[ ={ }func(&arr[ ]) figure (bpassing addresses of individual array elements to function passing the entire array we have discussed that in the array name refers to the first byte of the array in the memory the address of the remaining elements in the array can be calculated using the array name and the index value of the element thereforewhen we need to pass an entire array to functionwe can simply pass the name of the array figure illustrates the code which passes the entire array to the called function calling function called function main(void func(int arr[ ]int ifor( ; < ; ++printf("% "arr[ ])int arr[ ={ }func(arr)figure passing entire array to function function that accepts an array can declare the formal parameter in either of the two following ways func(int arr[])or func(int *arr)when we pass the name of an array to functionthe address of the zeroth element of the array is copied to the local pointer variable in the function when formal parameter is declared in function header as an arrayit is interpreted as pointer to variable and not as an array with this pointer variable you can access all the elements of the array by using the expressionarray_name index you can also pass the size of the array as another parameter to the function so for function that accepts an array as parameterthe declaration should be as follows func(int arr[]int )or func(int *arrint )it is not necessary to pass the whole array to function we can also pass part of the array known as sub-array pointer to sub-array is also an array pointer for exampleif we want to send the array starting from the third element then we can pass the address of the third element and the size of the sub-arrayi if there are elements in the arrayand we want to pass the array starting from the third elementthen only eight elements would be part of the sub-array so the function call can be written as func(&arr[ ] )note that in case we want the called function to make no changes to the arraythe array must be received as constant array by the called function this prevents any type of unintentional modifications of the array elements to declare an array as constant arraysimply add the keyword const before the data type of the array look at the following programs which illustrate the use of pointers to pass an array to function