02/21/00
COM1100 Winter2000 Yuhong Yin
10
Array as function arguments – case 2
nQuestion: write a function that will find the max value in an array
n// function prototype
n int find_max(int g[], int size);
n 
n// function definition
n int find_max(int g[], int size) {
n int max = g[0]; 
n for(int i = 1; i < size; i++ ) {
n if (max < g[i])     max = g[i];
n } 
n return max;
n }
n