C语言打开文件出现错误窗口
#include<stdio.h>#include<stdlib.h>
int main(void)
{
char ch;
FILE * fp;
fp=fopen("name.txt","r+");
if(fp=NULL)
{
printf("Failed to open file.Bye\n");
exit(1);
}
while(ch=getc(fp)!=EOF)
putchar(ch);
fclose(fp);
return 0;
}
错误 1 error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. e:\源文件\c++源文件\文件\文件\wj.cpp 7