Hello, I have this file with input data it looks like this:
I'm having trouble figuring out how I can scan this in.... I have defined a structure data type like thisCode:Ann I. 103 Ann X. 11 Jim C. 106 Ann B. 123 John LongLastName 143 class size 3 drop 11 103 106
What I want to do is create a stack using linked lists with the student name in the .name member and the number under the student name in the .ID memberCode:typedef struct student { char name[11]; int ID; struct student* studentPtr; } STUDENT;
but I have extra information in my input file that I do not need to scan in yet, and I don't want it in my linked lists.... I'm having trouble figuring out how to make a loop that will stop after the last student.....
in this case:
I've declared these pointers to filesCode:John LongLastName 143
i've been trying different fscanf parameters and while loops... but they all go pass the student names and IDs dataCode:FILE *fin, *fout; fin = fopen("cp5.in", "r"); fout = fopen("cp5_test.txt", "w");
any suggestions?
Thank You



LinkBack URL
About LinkBacks


