Problem:
The normal code running under Visual C ++ 6.0 cannot run in the Visual Studio 20xx series. Sometimes the following error is prompted:
Error C4996:'Fopen ':This function or variable may be unsafe. Consider usingFopen_sInstead. To disable deprecation, use _ CRT_SECURE_NO_WARNINGS. See online help for details.
Solution:
There are two solutions:
1,Follow the prompts to change fopen to fopen_s. (similar errors generally indicate that the xxx function is insecure. You can solve this problem by adding a suffix _ s ), however, you may find that... the parameter type does not match, so you need to change the parameter type. Is there any trouble! So there is a second method!
2,Take Visual Studio 2012 as an example. After opening the Project, select Project>Project nameProperties... -> Configuration Properties-> C/C ++-> Command Line add this sentence to the following Additional Options:/D "_ CRT_SECURE_NO_DEPRECATE" and click OK, re-compile the program without warning!