Possible Duplicate:
fopen deprecated warning
While creating my project, I encountered this error:
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.
1> c:\program files (x86)\microsoft visual studio 11.0\vc\include\stdio.h(218) : see declaration of ‘fopen’
However, I have also included stdio.h and fstream as headers because others told me to do so.
I still encounter the error.
Here is my code for the part of the error:
Can anyone help me?
As the error states, you need to use fopen_s, or disable the security exception errors via adding
#define _CRT_SECURE_NO_DEPRECATEbefore your include.The reasoning behind these warnings, as well as how to disable them for various C Runtime functions, is described in detail in Security Enhancements in the CRT.