#include
int main()
{
//打开文件
FILE* fp;//FILE
fp = fopen_s("C:\\Users\\ni'kou\\Desktop\\temp.txt", "r");//文件的打开 //"r"
if (fp == NULL)
{
printf("fail to open the file\n");
}
else
{
printf("the file is open\n");
}
//关闭文件
fclose(fp);
}
注释文件的打开哪一行,报错显示函数调用的参数太少
还有fclose(fp)警告:fp可以为0;没有看懂什么意思
fopen_s和fopen函数参数不同
改为
fopen_s(&fp,"C:\Users\ni'kou\Desktop\temp.txt", "r");