给定的代码在C中编译,但在C++中失败。int main() { const int x; /* uninitialized const compiles in C but fails in C++*/ } 从C变为C++的原理和原因是什么? 最佳答案 请参阅兼容性附录C.1.6中的规范: