to_struct_grades_base.c

This solution uses different arrays to store the data from the files.  Your task is to upgrade it using structures.

  • Declare a structure type. It’s recommended to use typedef so that you don’t need to include struct in all of the declarations.
  • When using a header file, the structure should also be declared there – this way when you end up having multiple code files, the structure type can be accessed by all of the files that need it.
  • Declare a structure array in the main() function! Each member of the array will represent one of the subjects and its grades.

DO NOT just put the variable declarations inside of the structure and declare it as a single structure – this would defeat the purpose of structures. We need an array of structures. Each member of the struct array should contain the information for one subject (name, grade count, grades). You’re welcome to add additional fields if necessary.