• 全部
...

请教 vs2005中 warning C4996: 'sprintf' was declared deprecated

ersa 2007-11-08 01:06:50
在vs2005中 用sprintf 会出现
warning C4996: 'sprintf' was declared deprecated
see declaration of 'sprintf'
的警告?怎么解决?
...全文
给本帖投票
3537 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
晨星 2007-11-08
  • 打赏
  • 举报
回复
不屏蔽的话就只能调用VS2005鼓吹的那些带“_s”后缀的非标准函数。
鱼与熊掌不可兼得,楼主自忖之。。。
opengl3d 2007-11-08
  • 打赏
  • 举报
回复
sprintf_s
ersa 2007-11-08
  • 打赏
  • 举报
回复
还有其他方法吗? 不采用屏蔽的方法 ,那么在vs2005中应该使用sprintf的哪种形式 或者有新的函数取代 sprintf?
晨星 2007-11-08
  • 打赏
  • 举报
回复
文件最开始:
#define _CRT_SECURE_NO_DEPRECATE
或者干粹在工程属性中设置。
飞哥 2007-11-08
  • 打赏
  • 举报
回复
Compiler Warning (level 1) C4996
'function': was declared deprecated

The compiler encountered a function that was marked with deprecated. The function may no longer be supported in a future release. You can turn this warning off with the warning pragma (example below).

#pragma warning(disable : 4996)

65,176

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧

手机看
关注公众号

关注公众号

客服 返回
顶部