Constants are fixed values that do not change during the execution of the program. Constants can be any basic data type, such as Integer constants, floating-point constants, character constants, string constants, and enumeration constants.
Constants can be used as regular variables, but their values cannot be modified after they are defined.
The basic types of constants are:
Integer constants: Integer constants can be hexadecimal (beginning with 0x), octal (starting with 0), decimal, integer constants can also have suffixes u and l, suffixes can be uppercase or lowercase, can be any combination, but cannot be repeated
Example:
032UU /* Illegal: cannot repeat suffix */, 30ul/ * unsigned long * /, 30u/* unsigned int */ /c7> , 30l/ * long * *
Floating-point constants: decimal or exponential form to represent floating-point constants
Character constants: A character constant can be a normal character (for example, ' X '), an escape sequence (such as ' \ t '), or a universal character (such as ' \u02c0 ').
String constants: There can be two forms, enclosed in "", or enclosed in @ "".
Enumeration constants
Custom constants: Const <data_type> <constant_name> = value; such as const double PI = 3.14159;
C # Constants