Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to judge the legal constants in C language?
How to judge the legal constants in C language?

Integers are divided into prefixes (, x) and suffixes (u, l), and the numbers used in each system are different;

floating-point suffixes f and l, and the exponent indicates whether the attention is within the range;

characters and strings mainly pay attention to whether the escape character is legal or not;

a: commas are not allowed in integers;

b: scientific counting means 1.5 times 1 to the second power, because the exponential part of scientific counting can only be an integer.

the c: \ sign is an escape symbol followed by other symbols to represent specific characters, so you write back quotes without following anything here;

d: the string constant is two consecutive characters, the ascii code of the first character is 7, the ascii code of the second character is as the ending symbol of the string, and the first character is the bell symbol, which will make the default speaker sound when outputting.

Extended information:

A string constant is a sequence of characters enclosed in double quotation marks.

character constants can be assigned to character variables, such as "char b='a';" , but you can't assign a string constant to a character variable, and you can't assign a string constant!

for example, the following are legal string constants:

"how do you do.", "China", "a", "$123.45", "c language programming", "a\\n", #123 "and" "are string constants

storage: strings. Therefore, a string with n characters should occupy (n+1) bytes in memory.

Baidu encyclopedia-string constants