我在代码中写了一些类似的东西
const int x=1; int *ptr; ptr = &x; *ptr = 2;
这适用于所有编译器吗?为什么GCC编译器没有注意到我们正在改变一个常量变量?
c pointers const
c ×1
const ×1
pointers ×1