#include
using namespace std;
class Circle
{
private:
int x;
int y;
int r;
public:
Circle(int xx,int yy,int rr)
{
this->x=xx;
this->y=yy;
this->r=rr;
cout<<"构造函数"<}
~Circle()
{
cout<<"析构函数"<}
void output()
{
cout<<"x="<x< cout<<"y="< y< cout<<"r="< r< }
};
int main()
{
Circle *c=new Circle(1,1,2);
c->output();
delete c;
return 0;
}
这没啥难度的啊。看看书~~~