I have 4 header files, all of them open data from a txt file with _wfopen(), like below:
FILE* file = _wfopen(L"data.txt",L"r,ccs=utf-8");
VC++ gives me an error C4996 but in one header file only, the other three have no error at all. How can I fix this ?
UPDATE:
My professor gave me this code.I compiled it and there’s only C4996 warning.Since I need to reuse it, I created a new project and copy everything in his code into the new project.Then it gave me a C4996 error.
A shallow search on the web indicates that you are using a deprecated function, raising, thus, the error C4996. As the example presents, you should be using the function _wfopen_s instead.
The reason you have this error pointed only once for all of your four calls is that the compiler suppresses repeated errors.
Ref: http://msdn.microsoft.com/en-us/library/yeby3zcb.aspx