Why does the compiler give me the following error message on the provided code: \"initializer element is not constant\". The corresponding C/C++ code compiles perfectly und
@dreamlax is correct, you can't have a const declaration whose initialization depends upon another (const) variable. If you need one to depend on the other, I suggest creating a variable that you can treat as a constant and initialize it only once. See these SO questions for details: