passing arrays to functions --------------------------- the array processing routines. we look at what best can be done by encapsulating each one in a seperate C++ function. in each case, we will have to pass the array, as a parameter, to the function; the function will process the array in a particular way and return the required output from this processing back to the caller of the function. When an array is passed to a function as a parameter, the function can access the elements of array, but function does not automaticly know how many elements are in the array; so, we will also need to pass the lenght of the array to the function. *the following program creates an array of integers, fills it with values & passes it to a function which sums the values. //summing an array #include int sum_array(int list[], int lenght); void main(void) { int list[15]; //the array for (int i = 0; i < 15; i++) { cout <<"Enter a value for the element " << i << " "; cin >> list[i]; } int total = sum_array(list, 15); //function call cout <<"The sum of the array is " << total << endl; } int sum_array(int list[], int lenght) { int total = 0; for (int i = 0; i < lenght; i++) total +=list[i]; return total; }