摘要:
函数返回引用: 函数返回对象: 阅读全文
posted @ 2018-09-17 15:46
Jary霸
阅读(260)
评论(0)
推荐(0)
摘要:
还需要注意: 1.常对象或常引用或常指针只能调用常成员函数。但是普通对象(无const修饰)都能调用, 即:既能调用常成员函数,也能调用非常的。 2.常成员函数只能调用常成员函数,不能调用非常函数。 阅读全文
posted @ 2018-09-17 11:42
Jary霸
阅读(331)
评论(0)
推荐(0)
摘要:
#include using namespace std; class Array { public: friend class A; // 好了,这时候类A可以使用Array里面的任何函数和变量了! Array(int age); void eat(); private: int age; }; Array::Array(int age) { ... 阅读全文
posted @ 2018-09-17 09:41
Jary霸
阅读(91)
评论(0)
推荐(0)

浙公网安备 33010602011771号