im having problem understanding how would i make the grades work cause each student has five grades and there are 10 different students, so would the MAX_GRADES be 5 or is it gonna be like 2D array.... grades ? ........ any hints, clues?
Yes. If it helps you can name it MAX_GRADES_PER_STUDENT
What you want to do is
- Define a pointer to Student struct (Student*)
- Use 'new' to allocate memory for 10 Student objects
- Set the data for each of the students. The syntax is the same as when using arrays
You don't need to modify the MAX_GRADES or anything else in the student struct.
Treat the struct just like any other variable.
You declare the an array of structs just like you do for a array of chars or ints.
int* a = new int;
or for your case
Student* students_array = new Students;