Loading

摘要: c++类中可以用const关键字来声明不修改对象的成员函数,它使用时需要注意: 1、常量对象只能调用const成员函数 2、非常量对象可以调用const成员函数 以下列代码为例,来解释: 1 class Person{ 2 public: 3 void print(){ 4 cout<<"I am 阅读全文
posted @ 2017-04-29 21:29 lif323 阅读(225) 评论(0) 推荐(0)