Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Why doesn't the c language Scanf function add the address operator &;
Why doesn't the c language Scanf function add the address operator &;
The string in C language is in the form of an array, and the name of the array can represent its address, so there is no need to add address characters to the string input. However, the name of a single character, integer variable, etc. Can't directly represent the address, so you need to add address characters.

data type

String data type is a data type modeled according to the idea of formal string. String is a very important and useful data type, which can be implemented in almost all programming languages.

In some languages, they can be obtained as basic types, while in other languages, they can be obtained as compound types. The syntax of most high-level languages allows strings that are usually referenced in some way to represent instances of string data types; This meta-string is called "text" or "string text".

Extended data

character string

The string in C language is actually a char array ending with the character' \0'. You don't need a reference library to use character types, but you need some functions in the C standard library to operate on strings. They are different from character arrays. Using these functions requires a reference to the header file.

File input/output

In C language, input and output are realized by a set of functions in the standard library. In ANSI C, these functions are defined in the header file.

Standard input/output

The standard I/O library predefined three kinds of standard input/output:

1, standard input standard input

2.stdout standard output

3.stderr input and output errors

Baidu Encyclopedia-String

Baidu encyclopedia -c language