关于C语言文件读取fopen函数的问题
刚入门学习C语言,用VS2012平台,使用fopen函数时报错:
设断点逐步运行时,出现报错:
>c:\users\administrator\desktop\test\test\test.c(14): error C2143: 语法错误 : 缺少“;”(在“类型”的前面)
这样就能运行了,求解答,谢谢!
另外,VS配置了opencv 不知是不是受这个影响
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void)
{
FILE * fp;
if (fopen_s(&fp,"C:\\Users\\Administrator\\Desktop\\EGM96","r")!=0)
{
printf("The file open error!\n");
exit(0);
}
int a;
a=fclose(fp);
return 0;
}设断点逐步运行时,出现报错:
>c:\users\administrator\desktop\test\test\test.c(14): error C2143: 语法错误 : 缺少“;”(在“类型”的前面)
int main(void)
{
FILE * fp;
/*if (fopen_s(&fp,"C:\\Users\\Administrator\\Desktop\\EGM96","r")!=0)
{
printf("The file open error!\n");
exit(0);
}*/
int a;
//a=fclose(fp);
return 0;
}这样就能运行了,求解答,谢谢!
另外,VS配置了opencv 不知是不是受这个影响
...全文


