首页 > 试题广场 >

使用Integer类,定义派生类Vector类: cl

[问答题]

使用Integer类,定义派生类Vector类:

class Integer
{   //…
protected :
int n;
};
class Vector:public Integer
{   //…
protected :
int *v;
};

其中,数据成员v用于建立向量,n为向量长度。要求:类的成员函数可以实现向量的基本算术运算。

发表于 2021-04-19 02:00:10 回复(0)