Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
来源:互联网 发布:拔罐 菲尔普斯 知乎 编辑:程序博客网 时间:2024/05/21 10:02
This function or variable may be unsafe错误
在VS 2012 中编译 C 语言项目,如果使用了 scanf 、fopen、printf等函数,编译时便会提示如下错误:
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.
原因是Visual C++ 2012 使用了更加安全的 run-time library routines 。新的Security CRT functions(就是那些带有“_s”后缀的函数),请参见:
《CRT函数的安全增强的版本》
解决方案
在代码文件最开始前面加入代码
#pragma warning(disable:4996)
1 1
- Visual Studio 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- 小米 muiu
- Unity DoTween 简明快速使用教程
- HTML5
- Codeforces 710C_Magic Odd Square(构造)
- 玩无限消乐的设计示例(高级篇)积分与特效的数值加载
- Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
- 路由器的工作原理
- typedef struct和struct区别
- LOG4J2 异步日志
- POJ 1523 Tarjan求割点
- PHP底层赋值原理
- Android项目集成信鸽推送过程详解
- 插入排序
- Java锁--Lock实现原理(底层实现)