这段哪里有一个错误啊?
#include<iostream.h>class point
{
privete:
int x,y;
public:
point(int a=0,int b=0)
{
x=a;
y=b;
}
point(point &p);
int getx()
{
return x;
}
int gety()
{
return y;
}
};
point::point(point &p)
{
x=p.x+10;
y=p.y+20;
cout<<"调用拷贝构造函数"<<endl;
}
void f(point p)
{
cout<<p.getx()<<" "<<p.gety()<<endl;
}
point g()
{
point q(3,5);
return q;
}
void main()
{
point p1(2,4);
point p2(p1);
cout<<p2.getx()<<" "<<p2.gety()<<endl;
f(p2);
p2=g();
cout<<p2.getx()<<" "<<p2.gety()<<endl;
}