c - Is there a way to use const variables in the definitions of other constants? -
I would like to use some predefined constants in the definition of a new stability, but my compiler does not like it:
const int = 1; Const int b = 2; Const int c = a; // Error: The initial element is constant const int sum = (a + b); // Error: The initial element is not constant Is there any way to define consistently using values of other constants? If not, what is the reason for this behavior?
Convert wars can not be defined as expressions.
#define A (1) #define B (2) #define C (A + B) const int = a; Const int b = B; Const int c = C;
Comments
Post a Comment