class CAT{
public:
CAT();
CAT(const& CAT&);
~CAT();
int GetAge() const { return *itsAge; }
void SetAge(int age){ *itsAge=age; }
protected:
int* itsAge;
};
课本上课后题中定义的一个类
其中CAT(const& CAT&);对吗? 能这么用吗?
如果可以的话const& CAT&又是什么意思?
一只斗牛犬
慕丝7291255
慕的地10843
随时随地看视频慕课网APP
相关分类