下面程序把从终端读入的 10 个整数以二进制方式写到一个名为 bi.dat 的新文件中,请填空。 #include
FILE *fp; int main(){ int i,j; if((fp=fopen("bi.dat","wb")==NULL)){ printf("cannot open file !\n"); exit(0); } for(i=0; i<10; i++){ scanf("%d",&j); fwrite(&j, sizeof(int) ,1, ); } fclose(fp); return 0; }