填空题
下列程序是处理C盘根目录下的a.txt文件,统计该文件中字符的个数。请填空,使程序完整。
#include <stdio.h>
main()
{
FILE*fp;char ch;
long num=0;
if(______)
{
printf("Can’t open file !\n");
exit(0);
}
while(______)
{ ch=fgetc(fp);
______;
}
printf("%d",num);
fclose(fp);
}
【参考答案】
(fp=fopen("c:\\a.txt"),"r")==NULL , !feof (fp) ,fputc (ch,fp......
(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)