为何读取失败?????最近被文件读取给缠身了
我用下面的语句读取文件内容,文件内容如下:01001
C语言程序设计
1
C语言程序的基本单位是
A 程序行 B 语句 C 函数 D 字符
C
0
为什么第五行的A读不出来,是不是我下面的程序行有问题呢?
fscanf( fp1, "%s", question.order );
fscanf( fp1, "%s", question.tip );
fscanf( fp1, "%d", &question.level );
i = 0;
fgetc( fp1 );
while( ( c = fgetc( fp1 ) ) !='\n' )
question.content[i++] = c;
question.content[i] = '\0';
i = 0;
fgetc( fp1 );
while( ( c = fgetc( fp1 ) ) !='\n' )
question.choices[i++] = c;
question.choices[i] = '\0';
fscanf( fp1, "%c", &question.answer );
fscanf( fp1, "%d", &question.times );