I'm making a program that ask the user for 10 grades so that the program can average it out but I'm only getting 1 as the average. Plus if anyone can explain passing arrays through other functions that would be nice too.
I love you bro thanks totally helped. What I want to understand though is that why don't you put the [] here res=averageGrades (grade, 10); I still don't understand passing arrays through functions very much and my teacher wants us to get in the habit of using multiple functions.
is preferred to magic numbers, notice that magic numbers cause a problem in this example because the array is only 9 members long while the FOR loop iterates 10 times. A const int prevents this.
edit: just to clarify, replace all of the cases of 10 or 9 in the code, which are meant to reference the number of grades to average, with NUM_GRADES.
for example: for(int i = 0; i < NUM_GRADES; i++) // do something;