警告又出现了!
文件头中已经包括了如下文件和说明,但是下面红色部分的代码编译的时候出了下面的警告,大家帮帮解决下呀?谢谢!
#include <fstream>
#include <iostream>
#include <string>
#include <cstdio>
using std::string;
using std::ofstream;
using std::ifstream;
using namespace std;
编译的代码:
FILE* pfile=fopen(FileName,_T("r"));
fseek(pfile,0,SEEK_SET);
fscanf(pfile, "%[^\n] ", str_line);
上面红色部分代码编译的提示下列警告:
1>c:\documents and settings\scan\desktop\kdtree\kdtree\globalvariable.cpp(38) : warning C4996: 'fopen' was declared deprecated
1> d:\program files\microsoft visual studio 8\vc\include\stdio.h(234) : see declaration of 'fopen'
1> Message: 'This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
1>c:\documents and settings\scan\desktop\kdtree\kdtree\globalvariable.cpp(40) : warning C4996: 'fscanf' was declared deprecated
1> d:\program files\microsoft visual studio 8\vc\include\stdio.h(249) : see declaration of 'fscanf'
1> Message: 'This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'