Need help with program storing multiple arrays/structs of student info

This is a program for cert 4 where you enter info about a student to a struct and some calculations are made.

I'm trying to figure out how to store and output multiple students, per LB's recommendation the input function returns student info. I just need to figure out how to store the info in an array and output it at the end.
Last edited on
Do you have a question?
The main thing I need to figure out is how to be able to input and store information for more than one student.
Make newStudent inside of your input function instead of on line 26, and then change your input function to return it from the function.

Then, in main, you can call it in a loop and store each returned student in an array/vector.
How do you return a struct from a function?
Last edited on
Prophet wrote:
How do you return a struct from a function?
The same way you return any other type from a function:
1
2
3
4
5
return_type function_name(parameters...)
{
    //...
    return instance;
}
Last edited on
Topic archived. No new replies allowed.