The following snippet of code is completely valid in C++ (at least gets compiled):
my_file.cxx:
static const int MY_CONST_ONE = 1; static const int MY_CONST_TWO = MY_CONST_ONE; On the other hand, compilation of exactly the same code in C fails with the error message (http://ideone.com/erBkm9):
my_file.c:2:1: error: initializer element is not constant my_file.c:
static const int MY_CONST_ONE = 1; static const int MY_CONST_TWO = MY_CONST_ONE; What is the reason? Is it something compiler-specific or some known C vs C++ difference?