我被读取文件内容弄得乱七八糟了呀,再次求助
01001C语言程序设计
C语言源程序后缀名是()
A.C B.TXT C.EXE D.H
A
0
文档里有这么些内容 我用fscanf函数读取了前面三行
然后第四行我该怎么读取?
我用的如下的函数进行读取的,前面三行都成功读取,但是第四行没有成功,求助!
程序代码:
void get() { FILE *fp1; Question question; fp1 = fopen( "question.txt", "r" ); fscanf( fp1, "%s", question.order ); fscanf( fp1, "%s%s", question.tip, question.content ); fseek( fp1, 1, SEEK_CUR ); fgets( question.choices, strlen( question.choices ) - 1, fp1 ); question.choices[99] = '\0'; fscanf( fp1, "%c%d", &question.answer, &question.times ); printf( "%s\n%s\n%s\n%s\n%c\n%d\n", question.order, question.tip, question.content, question.choices, question.answer, question.times ); }