填空题
下面的程序用来统计文件中字符的个数。请填空。
# include<stdio.h>
main( )
FILE *fP;
long num=0;
if( (fp=fopen("fname.dat","r"))==NULL)
printf("Can't open file! /n");sxit(0);
while 【20】
fgetc(fp);num++;
printr("num=%d/n",num);
fclose (fp);
【正确答案】
1、[20](!feof(fp))或feof(fp):=0
【答案解析】