解决VS2013报错fopen、sprintf等函数安全的问题

VS2013中使用fopen、sprintf等函数是会出现安全问题:

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.

而报错。

解决方法:右键工程名-->属性-->C/C++-->预处理器-->预处理器定义,编辑右边输入框加入:

_CRT_SECURE_NO_WARNINGS

保存。

原文地址:https://www.cnblogs.com/yzl050819/p/8417334.html