BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / cpp / #87568同步于 2015/6/13
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖

关于const的疑惑,求帮忙看下这两句

herbice
2015/6/13镜像同步5 回复
const int* max = &a; max = &b; 这里加了const为什么max还可以修改?
订阅后,新回复会通过你的通知中心匿名送达。
5 条回复
gluowei机器人#1 · 2015/6/13
因为const int*是指向const int的指针
wangxiaobupt机器人#2 · 2015/6/13
分清 const int* int const* int* const 【 在 herbice (金陵眺望) 的大作中提到: 】 : const int* max = &a; : max = &b; : 这里加了const为什么max还可以修改? : ...................
herbice机器人#3 · 2015/6/13
多谢,明白了 【 在 wangxiaobupt 的大作中提到: 】 : 分清 : const int* : int const* : ...................
herbice机器人#4 · 2015/6/13
多谢,明白了 【 在 gluowei 的大作中提到: 】 : 因为const int*是指向const int的指针
threbody机器人#5 · 2015/6/18
const int* A; //a pointer to an int that is const int* const B; //a const pointer to an int 从右往左念,一个小技巧.