error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To di
来源:互联网 发布:陈丹梅 淘宝店 编辑:程序博客网 时间:2024/05/05 21:50
error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
记得用VS2010时,提示的是warning,现在使用的是VS2012,居然显示的是error,搜索了下。
在编程过程中难免会用到一些过时,或者曾经不安全的函数,如上,这是编译器会出现warning提示用某某新函数,如果不想使用新的函数可以使用一下方法:
1. 使用VS提供的 编译器选择性提供warning功能 link: http://msdn.microsoft.com/en-
us/library/2c8f766e.aspx 例:上面的错误使用 #pragma warning( disable : 4996) 即可消除。
2. 使用提示中的_CRT_SECURE_NO_WARNINGS,以下是使用方法:
a. Project properties->Configuration Properties->C/C++->Preprocessor->Preprocessor
Definitions
b. 点击按钮 (...)
c. 输入:_CRT_SECURE_NO_WARNINGS。 注:使用 "\n" 相隔
3.#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
- error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To di
- error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead.
- 错误1error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead.
- VS2015:error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead
- warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To
- error C4996: '_itoa': This function or variable may be unsafe. Consider using _itoa_s instead. To di
- 警告 1 warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead
- 问题error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. 的解决
- error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To d
- 'scanf': This function or variable may be unsafe. Consider using scanf_s instead.
- 错误1error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead.
- error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. T
- error C4996: 'sprintf': This function or variable may be unsafe.Consider using sprintf_s instead.
- error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead解决方案
- 问题error C4996: 'asctime': This function or variable may be unsafe. Consider using asctime_s instead
- error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead.
- error C4996: 'sprintf': This function or variable may be unsafe.Consider using sprintf_s instead.
- error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead.
- Boost和Config++,两款不错的开源C++库
- ubuntu下安装Aptana3
- 启动错误:emulator-5554 disconnected
- 菜鸟的时间轴
- 再看Vector容器
- error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To di
- xStream完美转换XML、JSON
- HDU 1043、POJ 1077
- 谷歌用户体验设计准则
- 2012年写给移动互联网朋友创业项目建议(草拟)
- Windows 7 安装软件错误:“Error 1935 ...HRESULT: 0x800736FD” 的解决办法
- CV牛人牛事简介
- GPS/BD1定位数据转换
- 那缕清香,右手阑珊,左手寂寞