如果改成这样则c:\data.bin中无任何数据,c:\data.txt中正常显示
#include<stdio.h>
main()
{
FILE *f1,*f2;
int i;
char ch;
ch='h';
f1=fopen("c:\\data.txt","w");
f2=fopen("c:\\data.bin","wb");
printf("out:\n");
for(i=1;i<=100;i++)
{
printf(" %c ",ch);
/* fprintf(f1,"%c ",ch);*/
fwrite(&ch,sizeof(char),1,
f1);
if(i%10==0) printf( "\n");
if(i%10==0)fprintf(f1,"\n");
}
fclose(f1);
fclose(f2);
}