最近在学文件,发现有个问题,就是在Win-Tc上调试,若采用以下红色的那一句,就不行了。
#include<stdio.h>
main()
{
FILE *f;
char c;
//if(fopen("d:\\hdntv-2.51\\config.lss","r")==NULL) 为什么这一句与下面的两句的作用不是相同而且若使用这一句,则就不能正常显示了。
f=fopen("d:\\hdntv-2.51\\config.lss","r");
if(f==NULL)
{
printf("This file doesn't be opened.");
exit(1);
}
c=fgetc(f);
while (c!=EOF)
{
putchar(c);
c=fgetc(f);
}
fclose(f);
getch();
}