Constants in C language: direct constants and symbolic constants.
Direct constant refers to a form directly expressed by concrete data, which can be divided into integer constant, real constant, character constant and string constant.
Symbolic constants are constants defined by C language identifiers.
Integer constants are integer constants, including 10 radix, 8 radix and 16 radix. Such as:10,012, 0x0A.
Real constants are also called floating-point constants.
Character constants must be enclosed in single quotes. Such as:' m',' \n'
String constants should be enclosed in double quotes.
Symbolic constants can be represented by macro definitions or const keywords.
Extended data:
Constants include integer constants, floating-point constants, character constants and string constants. '
The definition of constant refers to defining symbolic constant, using an identifier to represent a constant, and realizing it through macro definition preprocessing instruction.
Format: # Defines an identifier constant.
User-named identifiers are symbolic constant names. As a symbolic constant name, it is usually capitalized. Once defined, symbolic constant names can be used to replace any constants in the program.
For programs that use symbolic constants, they will be replaced with actual constants before compilation.
Reference: Baidu Encyclopedia-Constant