Is there a way to use const variables in the definitions of other constants?
I would like to use some previously defined constants in the definition of a new constant, but my C compiler doesn't like it:
const int a = 1; const int b = 2; const int c = a; // error: initializer element is not constant const int sum = (a + b); // error: initializer element is not constant
Is there a way to define a constant using the values of other constants? If not, what is the reason for this behavior?