该程序无法运行,谁能看一下?
#include<iostream>using namespace std;
class circle
{ private:
int x;
int y;
int r;
public:
circle(int e,int f,int g);
void circle::setcircle(int e,int f,int g)
{x=e;y=f;r=g;}
int Getx(){return x;}
int Gety(){return y;}
int Getr(){return r;}
void showcircle();
};
void circle::showcircle()
{
cout<<"横坐标为"<<Getx()<<"纵坐标为"<<Gety()<<"圆的半径为"<<Getr()<<endl;
}
int main()
{ double pi=3.14,s;
circle BC(5,6,7);
s=pi*BC.Getr()*BC.Getr();
BC.showcircle();
cout<<"面积为"<<s;
system("pause");
return 0;
}
错误:
C:\DOCUME~1\administrator\LOCALS~1\Temp\ccCscaaa.o(.text+0x1f2) In function `main':
[Linker error] undefined reference to `circle::circle(int, int, int)'
C:\DOCUME~1\administrator\LOCALS~1\Temp\ccCscaaa.o(.text+0x1f2) ld returned 1 exit status