#include
using namespace std;
class Point{
int x,y;
public:
Point(int x0=0,int y0=0):x(x0),y(y0){}
double getx(){return x;}
double gety(){return y;}
};
class Rectangle{
Point c1;
int length,width;
public:
Rectangle(){}
Rectangle(int x,int y,int x1,int y1,int x2,int y2):c1(x,y),length(x2-x1),width(y2-y1){}
int area(const Rectangle &a);
void display(){
cout<<"矩形坐标:"<<"("<<c1.getx()<<","<<c1.gety()<<")"<<endl;
cout<<length<<" "<<width<<endl;
}
};
class Circle{
Point c2;
int r;
public:
Circle(){}
Circle(int x,int y,int i):c2(x,y),r(i){}
};
int Rectangle::area(const Rectangle &a){
int i;
i=length*width;
return i;
}
class Cuboid:public Rectangle,Circle{
Rectangle b;
int high,volume;
public:
Cuboid(Rectangle &Rec,int h,int v):b(Rec),high(h),volume(v){}
void Vol(const Cuboid &a);
void show();
};
void Cuboid::Vol(const Cuboid &a){
volume=high*area(b);
}
void Cuboid::show(){
Rectangle::display();
cout<<high<<volume<<endl;
}
int main(){
Rectangle a(10,10,10,20,30,30);
Cuboid c(a,10,10);
c.show;
return 0;
}
主程序中的c.show无法解析重载函数的地址,该如何解决