VS uses scanf to report errors and their solutions
This article mainly introduces in detail the solution to error reporting using scanf in VS2015. It has certain reference value. Interested friends can refer to it.
The example in this article shares with you the use of scanf in VS2015. The solution to the error is for your reference. The specific content is as follows
1. Add:
#define_CRT_SECURE_NO_DEPRECATE
at the beginning of the program. 2. In the program Add at the front:
#pragma warning(disable:4996)
3. Change scanf to scanf_s;
4. There is no need to add that line of code at the front of the program, just uncheck "SDL Check" when creating a new project;
5 , If the project has been established, you can also turn off SDL in the project properties ; the VS I use is the Chinese version
(1), I Change "Yes" to "No", and when compiling the same code, the following warning appears, which is not an error:
(2). If you do not change it, it is an error. , not a warning:
#6. Just set it up in the project: put the macro definition that reports the error in: Project Properties-----C/C++--- -Preprocessor------Preprocessor definition
7. Add in the project properties----C/C++----command line: /D _CRT_SECURE_NO_WARNINGS will do.
【Related Recommendations】
2. ASP Tutorial
3. Li Yanhui ASP basic video tutorial
The above is the detailed content of VS uses scanf to report errors and their solutions. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

When using Go language, we may encounter "undefined:fmt.Scanf" error. This error usually occurs when we try to use the Scanf function of the fmt package and for some reason this function is not recognized. In the Go language, the fmt package is a very important package and contains many functions for formatting input and output. Among them, the Scanf function is a function used to read data in a specified format from standard input. If we want to read

Solutions to the ignored return value of scanf include checking the return value of scanf, clearing the input buffer, and using fgets instead of scanf. Detailed introduction: 1. Check the return value of scanf. You should always check the return value of the scanf function. The return value of the scanf function is the number of successfully read parameters. If the return value is inconsistent with the expected one, it means that the input is incorrect; 2 , Clear the input buffer. When using the scanf function, if the input data does not match the expected format, the data in the input buffer will be lost, etc.

C language scanf input format optimization tips are shared in C language. We often need to obtain data from user input. The scanf function is a commonly used input function. However, there are some details that need to be paid attention to when using the scanf function to ensure that the input data can be read and processed correctly. This article will share some tips for optimizing the scanf input format and give specific code examples. Using the format character: The format character is a character used by the scanf function to specify the type of data to be read. Common format characters are:

A thorough understanding of the input format control of the scanf function in C language requires specific code examples. In C language, the scanf function is a commonly used input function that allows us to read data from user input and store it in variables. In order to better control the input format, the scanf function provides input format control characters, through which we can specify the input data type and some specific format requirements. Below we use some specific code examples to explain the input format control of the scanf function in detail.

C language is a very important programming language. Many beginners often use the input function scanf() in the process of learning and using C language. Through the scanf() function, we can obtain input data from the user and then store it in the specified variable. This article will introduce the input format examples and analysis of scanf(), and provide you with specific code examples. In C language, the format control string of the scanf() function is used to specify the format of the input data. Below we will discuss different types of

C language is a widely used programming language, and input is a very important part of the programming process. In C language, the scanf function is a function used to receive data from an input stream. This article will introduce the input format of the scanf function in detail and further explain it through specific code examples. When using the scanf function for input, we need to use different format control characters to specify the input data type. The following are some commonly used format control characters and their corresponding data types: %d: used to receive integer data. %f:

The usage and precautions of the scanf function in C language. As one of the most commonly used input functions in C language, the scanf function plays an important role in program development. It can receive user input data from the standard input stream (keyboard) and store it in the specified variable. This article will introduce the usage of the scanf function and some matters needing attention, and provide specific code examples. Basic usage of scanf function The prototype of scanf function is as follows: intscanf(constchar*f

Title: Using the scanf function to implement data input and processing in C language. In C language, the scanf function can be used to easily implement data input and processing. The scanf function is a function in the C language standard library. Its function is to read data from the standard input (usually the keyboard) and store the read data into the specified variable in the specified format. The following will use specific code examples to illustrate how to use the scanf function for data input and processing. First, we need to introduce the basis of the scanf function
