Before anything, english isn't my main language, so, excuse any mistakes.
I started to learn how to use files in C just a couple of days ago, and I'm having trouble with this piece of my code:
while(!feof(fp)){
fscanf(fp, "%04d\t%s\n", &code, students[ind].disc[0].name);
if(code == dcode) return 1;
}
code it's an inside fuction variable, and dcode is the course code to comparison, basicly, the function needs to compare if the course code inseerted exists, and then assign the course name to the .name element of the students structure. The file is opening correctly, and the it's structured in this way:
0101 Math
0102 History
and so...
can you guys help me?