while(fscanf(fp,"%d%s%s%s%s%d",&p->num,p->name,p->author,p->pub,p->where,&p->count)!=EOF)重点是fscanf和EOF

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/07 02:37:33

while(fscanf(fp,"%d%s%s%s%s%d",&p->num,p->name,p->author,p->pub,p->where,&p->count)!=EOF)重点是fscanf和EOF
while(fscanf(fp,"%d%s%s%s%s%d",&p->num,p->name,p->author,p->pub,p->where,&p->count)!=EOF)
重点是fscanf和EOF

while(fscanf(fp,"%d%s%s%s%s%d",&p->num,p->name,p->author,p->pub,p->where,&p->count)!=EOF)重点是fscanf和EOF
fscanf是读取文件里面存放的信息,是按格式读取的,eof是判断文件结尾没有.
这个循环就是读取信息到文件结尾处开始执行循环内容.