warning C4996: 'sprintf' was declared deprecated see declaration of 'sprintf'

方法1:
VC6---选项Project | Configuration Properties | C/C++ | Preprocessor | Preprocessor Definitions
添加_CRT_SECURE_NO_DEPRECATE和_SCL_SECURE_NO_DEPRECATE两个宏
VS2005 项目属性 --> C/C++ --> 预处理器 --> 预处理定义下
添加_CRT_SECURE_NO_DEPRECATE和_SCL_SECURE_NO_DEPRECATE两个宏

方法2:
或调用VS2005鼓吹的那些带“_s”后缀的非标准函数,即在其后加上"_S",如printf_s

方法3:
或文件最开始:
#define _CRT_SECURE_NO_DEPRECATE

你可能感兴趣的:(warning C4996: 'sprintf' was declared deprecated see declaration of 'sprintf')