Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What are literal constants and symbolic constants?
What are literal constants and symbolic constants?
1. literal constants: including integer constants, character constants and string constants. Note: There are no literal constants of structural types such as array constants and structural constants. But there are structural sign constants.

2. Symbolic constant: (you can define structural constants) constants defined by #define and const!

The difference between these two constants is:

Constants defined by #define do not occupy memory except literal constants of strings, so they can't take the address of constants, just macro replacement, for example:

① # Define the name "Pang Dong";

A literal constant whose essence is a string will occupy the "static storage area";

② # Define MAX 256

Essentially, it is a literal constant of shaping and will not allocate memory.