Why in C a const object is not a compile-time constant expression? [duplicate]
问题 This question already has answers here : Can a const variable be used to declare the size of an array in C? (5 answers) Closed 3 years ago . In C the const qualifier makes an object read-only but not a constant expression. For example, it is not possible to use a const int variable to dimension an array: const int n = 10; int arr [n]; /* Compile-time error */ Which is the technical reason for this? Is it not possible for the compiler at compile-time to know that the object has actually a