A constant is a quantity whose value cannot be changed during the running of a program. Constants are divided into direct constants and symbolic constants.
Direct constant
Direct constants are divided into integer constants, real constants, character constants and string constants.
Integer constants and real constants are generally called numerical constants.
Integer constants are constant integers expressed in decimal, octal and hexadecimal. It should be noted that octal constant integers are written with the number 0 as the prefix; Hexadecimal is prefixed with 0x.
Real constants are only expressed in decimal decimal form and exponential form, not in octal and hexadecimal form.
Character constants Character constants must be enclosed in single quotes. You can use controls, single quotes, double quotes, backslashes, and so on.
String constants are enclosed in double quotes.
Symbolic constant
Use identifiers to represent constants, which must be defined before use.