A类继承了B类,在A构造函数时不能A(B m,B #include #include #include class CPoint{public:\x05CPoint(double a,double b){x=a;y=b;}\x05double getx(){return x;}\x05double gety(){return y;}\x05void show()\x05{cout

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/12 20:35:48
A类继承了B类,在A构造函数时不能A(B m,B #include #include #include class CPoint{public:\x05CPoint(double a,double b){x=a;y=b;}\x05double getx(){return x;}\x05double gety(){return y;}\x05void show()\x05{cout

A类继承了B类,在A构造函数时不能A(B m,B #include #include #include class CPoint{public:\x05CPoint(double a,double b){x=a;y=b;}\x05double getx(){return x;}\x05double gety(){return y;}\x05void show()\x05{cout
A类继承了B类,在A构造函数时不能A(B m,B
#include
#include
#include
class CPoint
{
public:
\x05CPoint(double a,double b){x=a;y=b;}
\x05double getx(){return x;}
\x05double gety(){return y;}
\x05void show()
\x05{cout

A类继承了B类,在A构造函数时不能A(B m,B #include #include #include class CPoint{public:\x05CPoint(double a,double b){x=a;y=b;}\x05double getx(){return x;}\x05double gety(){return y;}\x05void show()\x05{cout
不是这个问题,是你的CPoint类的构造函数都要求有参数.
在CPoint中增加一个不需要参数的构造函数就OK了