Home Forums C Programming Help – file reading Re: Re: Help – file reading

#3531
Ernesto0751
Participant
int main ()
{
char matrix[20][200];
int i, j, no[20], quiz_1[20], quiz_2[20], quiz_3[20], project[20], midT[20];
FILE *infile;

infile = fopen("studentsmark.txt","r");

i=0;

while( fscanf(infile,"%d %s %d %d %d %d %d",&no, matrix, &quiz_1, &quiz_2, &quiz_3, &project, &midT) !=EOF) i++;



for(j=0;j {
printf("%d %s %d %d %d %d %dn",no[j], matrix[j], quiz_1[j], quiz_2[j], quiz_3[j], project[j], midT[j]);
}

fclose(infile);
}#include


int main ()
{
char matrix[20][200];
int i, j, no[20], quiz_1[20], quiz_2[20], quiz_3[20], project[20], midT[20];
FILE *infile;

infile = fopen("studentsmark.txt","r");

i=0;

while( fscanf(infile,"%d %s %d %d %d %d %d",&no
, matrix, &quiz_1, &quiz_2, &quiz_3, &project, &midT) !=EOF) i++;



for(j=0;j {
printf("%d %s %d %d %d %d %dn",no[j], matrix[j], quiz_1[j], quiz_2[j], quiz_3[j], project[j], midT[j]);
}

fclose(infile);
}

but i am unable to read tis line
No Matrix quiz1(5%) quiz1(5%) quiz1(5%) Proj(25%) MidT(20%)

what should i add to make the program read it and ignore it so it can read on the real data i need, i really have no idea…