从别处拷了段程序,在dev c++中报错,怎么修改?
dfczj 2007-06-01 05:28:04 #include<iostream>
using namespace std;
class point
{
public:
point(int xx,int yy){x=xx,y=yy;}
point(point &p);
~point(){cout<<"析构"<<endl;}
private:
int x;
int y;
};
point::point(point &p)
{
x=p.x;
y=p.y;
}
point fun2()
{
point A(1,2);
return A;
}
int main()
{
point B(1,2);
B=fun2();//这里报错,error: no matching function for call to`point::point(point)'
return 0;
}
在dev c++中报错,怎么修改?