This function or variable may be unsafe. Consider using scanf_s instead.

去掉安全检查,开头加上即可:

1 #define _CRT_SECURE_NO_WARNINGS

或者:

严重性代码 说明项目文件行禁止显示状态

错误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.hellof:usersdenggelindocumentsvisual studio 2015projectshellohello源.c6




右键项目,属性

预处理器,预处理器定义,编辑

新增:"_CRT_SECURE_NO_WARNINGS"

确定。

原文地址:https://www.cnblogs.com/denggelin/p/5379883.html