Macro-defined constants are replaced by a preprocessor. Constant variables are controlled in the same way as regular variables.
For example, the following code:
Would appear to the actual compiler as
int b = 8 + 10;
However, this code:
const int A = 8; int b = A + 10;
Will appear as:
const int A = 8; int b = A + 10;
:)
In practice, the main thing is that change is an area: constant variables obey the same definition rules as standard variables in C, which means that they can be limited or possibly redefined in a specific block without leakage - this is similar to the situation local and global variables.
source share