C语言中关于文件操作的一个问题!谢谢
#include <stdio.h>
main()
{
FILE *fp;
char str[11];
if((fp = fopen("1.c","r"))==NULL);
{
printf("can not open file 1.c!");
getch();
exit(1);
}
fgets(str,11,fp);
printf("%s",str);
fclose(fp);
}
以上是我的代码。
问题是:为什么我的文件打不开?就是fp的值为NULL。
我是在TURBOC2上编译的。