当前位置:网站首页>In VS_ In 2019, scanf and other functions are used to prompt the error of unsafe functions
In VS_ In 2019, scanf and other functions are used to prompt the error of unsafe functions
2022-07-03 22:30:00 【Camellia Populus】
stay VS_2019 Use in scanf Wait for the function to prompt the problem of unsafe function error
- stay VS Call in scanf、sprintf、strcpy、strcat When waiting for a function, you will often be prompted that the function is unsafe , It is recommended to use _s Safer function warnings
- as a result of Visual studio C++ Not really C++, But through Microsoft Company optimized
- Maybe those development engineers at Microsoft think these C There is no boundary check for memory inside the function , It is very likely to cause problems such as memory out of bounds , So an unsafe warning is set
Method 1 , Add a line of declaration at the beginning of the code
For shielding scanf() Error of equal function , Add the following code to the code , Put it on the top of the file !
#define _CRT_SECURE_NO_WARNINGS
Method 2 , Modify the properties of the file
- stay vs in , Right click to select the project name -> attribute -> C/C++ -> The preprocessor -> Preprocessor definition -> Add... To edit _CRT_SECURE_NO_WARNINGS This predefined .


边栏推荐
- WFC900M-Network_ Card/Qualcomm-Atheros-AR9582-2T-2R-MIMO-802.11-N-900M-high-power-Mini-PCIe-Wi-Fi-Mod
- On my first day at work, this API timeout optimization put me down!
- The 14th five year plan for the construction of Chinese Enterprise Universities and the feasibility study report on investment Ⓓ 2022 ~ 2028
- pycuda._ driver. LogicError: explicit_ context_ dependent failed: invalid device context - no currently
- 540. Single element in ordered array
- 2022 safety officer-a certificate registration examination and summary of safety officer-a certificate examination
- Market layout planning and latest dynamic analysis report of China's smart public security industry Ⓕ 2022 ~ 2028
- 2 spark environment setup local
- 1 Introduction to spark Foundation
- Quick one click batch adding video text watermark and modifying video size simple tutorial
猜你喜欢

Pointer concept & character pointer & pointer array yyds dry inventory

Firefox set up proxy server

The difference between SRAM and DRAM

Mysql database - Advanced SQL statement (I)

webAssembly

3 environment construction -standalone

Redis single thread and multi thread

On my first day at work, this API timeout optimization put me down!

Overview of Yunxi database executor

How can enterprises and developers take advantage of the explosion of cloud native landing?
随机推荐
On my first day at work, this API timeout optimization put me down!
Programming language (1)
LeetCode 1647. Minimum deletion times of unique character frequency
Covariance
What are the common computer problems and solutions
How can enterprises and developers take advantage of the explosion of cloud native landing?
IPhone development swift foundation 08 encryption and security
[Android reverse] application data directory (files data directory | lib application built-in so dynamic library directory | databases SQLite3 database directory | cache directory)
2022 electrician (elementary) examination questions and electrician (elementary) registration examination
How to switch between dual graphics cards of notebook computer
Pointer concept & character pointer & pointer array yyds dry inventory
[SRS] build a specified version of SRS
Data consistency between redis and database
How to store null value on the disk of yyds dry inventory?
js demo 計算本年度還剩下多少天
Ansible common usage scenarios
6.2 normalization 6.2.5 third normal form (3NF)
Programming language (2)
JS closure knowledge points essence
Blue Bridge Cup -- guess age