const 修饰成员函数

112 阅读1分钟

int getValue(const char *key) const; 最后一个const修饰成员函数本身,表示不能在函数体内部修改类的成员