extern
const int &b = a;
const int *p
int* const p
const int * const p
mutable
class person{ public: int m_age; mutable int m_height; //用mutable修饰的特殊变量,即使在常函数中也可以进行修改 //该函数用const修饰,为常函数 void init_person() const { m_age = 100; //编译出错,此处相当于const person * const this->m_age = 100; this指针本身就是一个指针常量,这里加一个const修饰,就变成了常量常指针,既无法修改指向也无法修改指向地址内的值 m_height = 130; //编译通过,该变量用mutable修饰,可以在常函数中修改 } }