Hello im having a problem with my program. Im trying to read in two files called list.txt and teachers.txt and set them to an array called studentList[] and teacherList[] but i dont know how to do that, any suggestions? I know i have to use a for loop but i dont know how to scan each line of the file and set it equal to the first element of an array. This is the code i have so far:
typedef struct {
char StLastName[THIRTY];
char StFirstName[THIRTY];
int Grade;
int Classroom;
} student;
typedef struct {
char TLastName[THIRTY];
char TFirstName[THIRTY];
int Classroom;
} teacher;
int main() {
student studentList[TWO_HUNDRED];
teacher teacherList[FIFTY];
FILE *in;
FILE *in2;
in = fopen("list.txt","r");
in2 = fopen("teachers.txt","r");
return 0;
}