for (n=0;!feof(fp) && fread(&tongxun[n],sizeof(struct tongxunlu),1,fp);n++);是什么意思?

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/28 08:04:24
for (n=0;!feof(fp) && fread(&tongxun[n],sizeof(struct tongxunlu),1,fp);n++);是什么意思?

for (n=0;!feof(fp) && fread(&tongxun[n],sizeof(struct tongxunlu),1,fp);n++);是什么意思?
for (n=0;!feof(fp) && fread(&tongxun[n],sizeof(struct tongxunlu),1,fp);n++);是什么意思?

for (n=0;!feof(fp) && fread(&tongxun[n],sizeof(struct tongxunlu),1,fp);n++);是什么意思?
这个意思是这样,
初始条件,n=0;
每循环一次,n加1.
循环的过程中检查fp指向的文件:1.有没有到文件尾 2.每次读1个tongxun结构的字节数据是否成功.
其功能是实现,读取文件里面的tongxun结构的数据,每次读一个结构体,遇文件尾结束.