Answer to Question #69328 in C for LEE JIA WEI
“roster.txt” and stores them in an array of student_t variables such that the first
array slot stores information of the first student, etc. A0110793H 3 4 A- 4 C 4 B+
Function prototype is as follows.
void read_records(student_t stu);
int i, j;
FILE* f = fopen("roster.txt", "r");
for(i=0; i<4; i++)
/* I guess that number is number of grades */
fscanf(f, "%s %d", stu[i].name, stu[i].grades);
for(j=0; j<stu[i].grades; j++)
fscanf(f, "%d %s", stu[i].grade_val[j], stu[i].grade_letter[j]);
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!