Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What kinds of constants are there in C language?
What kinds of constants are there in C language?
3. 14 is a constant and a floating-point constant.

# Define PI 3. 14 This is a macro definition, and PI is a macro constant, or a "symbolic constant". When precompiling, the compiler will replace all pi in the program with 3. 14 as characters before compiling.

In the process of program execution, the quantity whose value is constant is called a constant. It can be classified according to data types, such as integer constants, floating-point constants, character constants and so on.

Other examples:

12345,98760 are all integer constants, and' A' 'a' 'b' '\n' are all character constants.

3 14 159E-5L 45.56F floating-point constant

0562, 0xff octal, hexadecimal integer constant, "my_string" string constant.