当前位置:网站首页>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 .


边栏推荐
- Supply and demand situation and market scale calculation report of China's portable energy storage power PES industry Ⓛ 2022 ~ 2028
- Creation of the template of the password management software keepassdx
- WFC900M-Network_ Card/Qualcomm-Atheros-AR9582-2T-2R-MIMO-802.11-N-900M-high-power-Mini-PCIe-Wi-Fi-Mod
- Exness: the Central Bank of England will raise interest rates again in March, and inflation is coming
- LeetCode 1646. Get the maximum value in the generated array
- How to switch between dual graphics cards of notebook computer
- In 2022, 6G development has indeed warmed up
- The latest analysis of R1 quick opening pressure vessel operation in 2022 and the examination question bank of R1 quick opening pressure vessel operation
- Summary of basic knowledge of exception handling
- 2022 G3 boiler water treatment registration examination and G3 boiler water treatment examination papers
猜你喜欢

The difference between SRAM and DRAM

6.0 kernel driver character driver

Awk getting started to proficient series - awk quick start

How to solve the problem of computer networking but showing no Internet connection

540. Single element in ordered array

How can enterprises and developers take advantage of the explosion of cloud native landing?

2022 electrician (elementary) examination questions and electrician (elementary) registration examination

What are the common computer problems and solutions

Exness: the Central Bank of England will raise interest rates again in March, and inflation is coming

Learning notes of raspberry pie 4B - IO communication (SPI)
随机推荐
Buuctf, misc: n solutions
The reason why the computer runs slowly and how to solve it
SDMU OJ#P19. Stock trading
Bluebridge cup Guoxin Changtian single chip microcomputer -- detailed explanation of schematic diagram (IV)
Morning flowers and evening flowers
regular expression
Rest reference
Development mode and Prospect of China's IT training industry strategic planning trend report Ⓣ 2022 ~ 2028
Investment analysis and prospect trend prediction report of China's boron nitride industry Ⓨ 2022 ~ 2028
JS closure knowledge points essence
Buuctf, web:[geek challenge 2019] buyflag
China's Call Center Industry 14th five year plan direction and operation analysis report Ⓔ 2022 ~ 2028
Wisdom tooth technology announced that it had completed the round D financing of US $100million and had not obtained a valid patent yet
Sow of PMP
320. Energy Necklace (ring, interval DP)
Summary of basic knowledge of exception handling
LeetCode 1647. Minimum deletion times of unique character frequency
IPhone development swift foundation 08 encryption and security
2022 safety officer-a certificate registration examination and summary of safety officer-a certificate examination
Analysis report on the development prospect and investment strategy of global and Chinese modular automation systems Ⓟ 2022 ~ 2027