VS2017如何使用scanf函数
前言
在VS2017中C++使用scanf函数,报出
错误 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.
解决方法
在代码页首行加入如下代码
#define _CRT_SECURE_NO_WARNINGS
在Visual Studio 2017中使用C++的scanf函数时,可能会遇到安全警告错误C4996。本文介绍了解决此问题的方法,即在代码的开头加入预处理器指令#define _CRT_SECURE_NO_WARNINGS,以禁用scanf函数的安全警告。
6527

被折叠的 条评论
为什么被折叠?



