我有这个代码:
const int a = 10; const auto *b = &a; //0x9ffe34 const auto c = &a; //0x9ffe34 int z = 20; b = &z; //0x9ffe38 //c = &z; //[Error] assignment of read-only variable 'c'
为什么可以分配新地址b而不是c?
b
c
c++ pointers const auto c++11
auto ×1
c++ ×1
c++11 ×1
const ×1
pointers ×1