// Example : This program finds the student with // the max score and outputs his/her // name. #include struct student { char name[20]; int score; }; // These are just declarations. // The function are defined after main() void getinput(student s[], int& size); student max_s(student s[], int size); void update(student& s); int main() { student s[10], max_student; int size; getinput(s, size); update(s[0]); max_student = max_s(s, size); cout << "The student with the highest score is "; cout << max_student.name << "\n"; return 0; } /********** The function definitions **********/ void getinput(student s[], int& size){ cout << "How many students ?\n"; cin >> size; cout << "Input the names and scores \n"; for (int a=0; a> s[a].name; cin >> s[a].score; } return; } student max_s(student s[], int size) { int max_index = 0; for(int a=1; a (s[max_index].score)) max_index = a; } return s[max_index]; } void update(student& s){ s.score++; return; }