当前位置:网站首页>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 .
边栏推荐
- Market layout planning and latest dynamic analysis report of China's smart public security industry Ⓕ 2022 ~ 2028
- How can enterprises and developers take advantage of the explosion of cloud native landing?
- C3p0 connection MySQL 8.0.11 configuration problem
- Electronic tube: Literature Research on basic characteristics of 6j1
- Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
- Summary of fluent systemchrome
- Exclusive interview with the person in charge of openkruise: to what extent has cloud native application automation developed now?
- 股票炒股开户注册安全靠谱吗?有没有风险的?
- China's coal industry investment strategic planning future production and marketing demand forecast report Ⓘ 2022 ~ 2028
- Pat grade A - 1164 good in C (20 points)
猜你喜欢
Redis single thread and multi thread
User login function: simple but difficult
2022 free examination questions for safety management personnel of hazardous chemical business units and reexamination examination for safety management personnel of hazardous chemical business units
Covariance
Bluebridge cup Guoxin Changtian single chip microcomputer -- hardware environment (I)
Shell script three swordsman awk
QGIS grid processing DEM data reclassification
Pat grade A - 1164 good in C (20 points)
Yyds dry goods inventory Spring Festival "make" your own fireworks
Quick one click batch adding video text watermark and modifying video size simple tutorial
随机推荐
Preliminary analysis of smart microwave radar module
Tkinter Huarong Road 4x4 tutorial III
What are the common computer problems and solutions
How to store null value on the disk of yyds dry inventory?
BUUCTF,Misc:LSB
DR-NAS26-Qualcomm-Atheros-AR9582-2T-2R-MIMO-802.11-N-5GHz-high-power-Mini-PCIe-Wi-Fi-Module
Es6~es12 knowledge sorting and summary
[SRS] build a specified version of SRS
Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
Firefox set up proxy server
IPhone development swift foundation 09 assets
Report on the development status and investment planning trends of China's data center industry Ⓡ 2022 ~ 2028
Development trend and market demand analysis report of China's energy storage battery industry Ⓩ 2022 ~ 2028
Bluebridge cup Guoxin Changtian single chip microcomputer -- detailed explanation of schematic diagram (IV)
[sg function] 2021 Niuke winter vacation training camp 6 h. winter messenger 2
Rest reference
Report on the development strategy of China's engineering bidding agency and suggestions for the 14th five year plan Ⓙ 2022 ~ 2028
Pointer concept & character pointer & pointer array yyds dry inventory
LeetCode 1647. Minimum deletion times of unique character frequency
Investment analysis and prospect trend prediction report of China's boron nitride industry Ⓨ 2022 ~ 2028