[VS error C4996] The best solution to the error

 How to solve such an error?

1. Use the scanf_s function provided by the VS compiler to replace the scanf function provided by the C language.

2. Just add such a definition directly at the beginning of the source file

#define _CRT_SECURE_NO_WARNINGS 1 

So if you add it every time you create a source file, wouldn't it be too complicated? Here's how you can have this sentence every time you create a source file.

1. Find the path of your compiler, refer to the file path below, and find the file pointed by the arrow.

2. Download a program such as notepad++ on your computer, and use this program to edit. (If you edit with Notepad, there is no permission. This program solves this problem very well.)


2. Write this sentence and save it.

 3. The point is, it’s fine, and there will be this sentence every time you create a source file.

Guess you like

Origin blog.csdn.net/m0_57549888/article/details/123990464