下面程序从一个二进制文件中读入结构体数据,并把结构体数据显示在终端屏幕上,请填入适当内容。 #include
struct rec{ int num; float total; }; int main(){ FILE *f; if((f=fopen("bin.dat","rb"))==NULL) {printf("can not open file !\n"); exit(0); } reout(f); fclose(f); return 0; } void reout( ){ struct rec r; fread(&r, , 1, f); while(!feof(f)){ printf("%df,%f\n", ); fread( , 1, f); } }