VS2019:严重性代码说明项目文件行禁止显示状态错误C4996:‘scanf‘: This function or variable may be unsafe

您所在的位置:网站首页 vs报错lnk1168 VS2019:严重性代码说明项目文件行禁止显示状态错误C4996:‘scanf‘: This function or variable may be unsafe

VS2019:严重性代码说明项目文件行禁止显示状态错误C4996:‘scanf‘: This function or variable may be unsafe

2023-09-10 22:56| 来源: 网络整理| 查看: 265

1.运行报错严重性 代码 说明 项目 文件 行 禁止显示状态错误: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.

在这里插入图片描述

2.关闭项目属性“SDL检查”

在这里插入图片描述

3.顺利运行通过

在这里插入图片描述

4.附上图片的完整测试代码(猜数字) #include "stdio.h" #include "conio.h" void main() { int Password=0,Number=0,price=58,i=0; while( Password != 12345 ) { if( i >= 3 ) return; i++; puts("Please input Password: "); scanf("%d",&Password); } i=0; while( Number!=price ) { do{ puts("Please input a number between 1 and 100: "); scanf("%d",&Number); printf("Your input number is %d\n",Number); }while( !(Number>=1 && Number= 90 ) { printf("Too Bigger! Press any key to try again!\n"); } else if( Number >= 70 && Number printf("Too Small! Press any key to try again!\n"); } else if( Number > 30 && Number if( Number == price ) { printf("OK! You are right! Bye Bye!\n"); } else if( Number


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3