标签: c linux pointers gcc const
const int var = 10; var = 20; // error: can not modify a const object const int var = 10; int *ptr = &var; *ptr = 20; // valid
(os:Linux编译器:Gcc)
为什么使用指针修改 const var?