data structures using passing arrays to functions like variables of other data typeswe can also pass an array to function in some situationsyou may want to pass individual elements of the arraywhile in other situationsyou may want to pass the entire array in this sectionwe will discuss both the cases look at fig which will help you understand the concept arrays for interfunction communication passing the entire array passing individual elements passing data values passing addresses figure one dimensional arrays for inter-function communication passing individual elements the individual elements of an array can be passed to function by passing either their data values or addresses passing data values individual elements can be passed in the same manner as we pass variables of any other data type the condition is just that the data type of the array element must match with the type of the function parameter look at fig (awhich shows the code to pass an individual array element by passing the data value calling function called function main(void func(int numprintf("% "num)int arr[ ={ }func(arr[ ])figure (apassing values of individual array elements to function in the above exampleonly one element of the array is passed to the called function this is done by using the index expression herearr[ evaluates to single integer value the called function hardly bothers whether normal integer variable is passed to it or an array value is passed passing addresses like ordinary variableswe can pass the address of an individual array element by preceding the indexed array element with the address operator thereforeto pass the address of the fourth element of the array to the called functionwe will write &arr[ howeverin the called functionthe value of the array element must be accessed using the indirection (*operator look at the code shown in fig (bwww allitebooks com