VS2012 how to deal with the problem of scanf function error, teach you a method, no need to set other in the future

For beginners in C language courses, they will download VS2010, VS2012, and VS2019, but there will always be a problem that the scanf function will report an error.
It is not a warning, but a direct error, as follows:
Insert picture description here
So how to solve this problem? Various solutions can be found on the Internet, such as:
Insert picture description here
this can also be solved, but every time you create a new project, you have to re-enter it, which is more troublesome, so today I will teach you a one-time solution to the problem, as follows:
1. Copy the error below One sentence is wrong: _CRT_SECURE_NO_WARNINGS
2. Find the location of your VS software, find the VC folder

Insert picture description here
3. Find vcprojectitems, and then find newc++file
Insert picture description here
4. Right-click to edit it, and write the error you just copied.
Insert picture description here
Insert picture description here
5. If the following error message appears, the permissions are not enough, then you should use high permissions to edit
Insert picture description here
6. We need to download a Notepad++ to edit it, this we can save it as an administrator
Insert picture description here
Insert picture description here
7. After editing, we create a new empty project, you can see that there is this sentence in the first line of the project by default. We don’t need to set other statements, and we don’t have to worry about reporting errors.
Insert picture description here

Guess you like

Origin blog.csdn.net/m0_46551861/article/details/106377494