FILE *fp = NULL;
!feof(fp)
fclose(fp);
###是什么玩意
是不是补全代码?如下:
#include <stdio.h>
main()
{
long num =0;
FILE* fp; //第一个地方
if((fp=fopen("fname.dat","r"))==NULL)
{
printf("Can't open the file;");
exit(0);
}
while (!feof(fp)) //第二个地方
{
fgetc(fp);num++;
}
printf("num=%d\n",num);
fclose(fp);//第三个地方
}