当前位置:网站首页>In VS, error c4996: 'scanf': this function or variable may be unsafe Solutions.
In VS, error c4996: 'scanf': this function or variable may be unsafe Solutions.
2022-07-19 05:42:00 【numb and dying】
One 、 Why it went wrong ?
C Functions in languages are unsafe . In the use of scanf Function time , The space occupied by the data to be placed is not detected ( Data may be out of bounds ), So this is not safe enough .VS Although the scanf_s function , But this is VS Function of , instead of C Functions of language , If you use scanf_s function , The portability of the code will be reduced , So... Is not recommended VS Function of .

![]()
Two 、 How to solve ?
1. Temporary settlement
Add #define _CRT_SECURE_NO_WARNINGS 1 after , Compile and run .

2. Permanent solution
stay VS Found in the installation directory newc++file.cpp file , If you can't find it , Specific documents , You can enter the installation directory first , Then use explorer to search ( It will be found soon ).

Right click Click on -> attribute Modify file permissions .

Open in Notepad , Join in #define _CRT_SECURE_NO_WARNINGS 1 after , preservation .

After preservation , To create a C Source file , Will be automatically added #define _CRT_SECURE_NO_WARNINGS 1
边栏推荐
- MySQL learning notes (5) -- join join table query, self join query, paging and sorting, sub query and nested query
- [efficiency of function]
- Could not locate zlibwapi.dll. Please make sure it is in your library path
- E-commerce user behavior real-time analysis system (flink1.10.1)
- Spark核心编程(4)--Spark运行架构
- 1.东软跨境电商数仓需求规格说明文档
- 正则替换group(n)内容
- 12. Ads layer construction of data warehouse construction
- 关于AS安装之后的一些细碎事项
- 9. Dim layer construction of data warehouse construction
猜你喜欢

5.数据采集通道搭建之业务分析

Wechat applet password display hidden (small eyes)

MySQL learning notes (5) -- join join table query, self join query, paging and sorting, sub query and nested query

static 关键字对作用域和生命周期的影响

Macro definition of C language

2021-05-21

跨域和处理跨域

Use ide to make jar package

1. Neusoft cross border e-commerce warehouse demand specification document

用facenet源码进行人脸识别测试过程中的一些问题
随机推荐
Object to map
Time difference calculation
Pointnet++代码详解(三):query_ball_point函数
C language & bit field
C language dynamic memory management
PCM silent detection
Coap在Andorid中的简单应用
Gradle custom plug-in
Write a timed self-test
写一个定时自检
【语音识别入门】基础概念与框架
Kotlin scope function
Geo_CNN(Tensorflow版本)
Ambari 2.7.5 integrated installation hue 4.6
Pointnet++代码详解(七):PointNetSetAbstractionMsg层
利用IDE打jar包
Problems encountered by kotlin generics
Bottomsheetdialogfragment imitation Tiktok comment box
gradle自定义插件
Scala初级实践——统计手机耗费流量(1)