运行VS出现warning C4996错误的解决办法

运行VS出现warning C4996错误,

warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.

解决办法:打开stdafx.h头文件,在include之前添加 #define _CRT_SECURE_NO_DEPRECATE 

原文地址:https://www.cnblogs.com/righere/p/5164505.html