How to deal with the warning of scanf in Visual Studio

1: Find the installation path of Visual Studio 2019, copy it, and open it on this computer.

1d8d2e76fb834eedbeb7b00528825846.png

 2: Find newc++file.cpp and double-click to open it.

554cb63a86624fe7a4157ce3bb36dfa6.png

 3: Add #define _CRT_SECUER_NO_WARNINGS 1 and save

c8746d87acd54eceb3bd2e76611690fd.png

 If the following appears

e240aa816bb549b3bc1b780b8d523f52.png

Go online to download notepad++

e59980d6842742289d25ae2b1a8129bc.png

Go back to the path you just opened, find newc++file.cpp again, right-click, and choose notepad++ to open

49e10c077ed64dda8c25637161789759.png

Then add the sentence just now

55158d6112cd4ae89cb9d8164054a765.png

 Save, the following content appears, click Yes

6b109596ade34d38ab9c48e16a5c75ac.png

 It's almost here, every time you open visual studio, there will be this sentence on the first line, and that's it. If the first line has

In other words, if it still doesn’t work, then there is still one more step to go. Find the file you just created, right-click, select Properties, select C/C++ SDL check, select No, and you can run it.

25d7d8633245456c996031046182bc91.png

 According to me, it can basically be used, and no more errors will be reported.

Guess you like

Origin blog.csdn.net/qq_69424518/article/details/126407791