【C++】不能将参数 1 从“Rect”转换为“int”(用的软件是VS2010)

图片说明

#include<iostream>
using namespace std;
class Point
{
    int x,y;
public:
    Point(int x=0,int y=0):x(x),y(y)
    {}
    int getX(){return x;};
    int getY(){return y;};
    void disp(){cout<<'('<<x<<','<<y<<')';}
};
class Rect
{
    Point ptLtTp,ptRtDn;
public:
    Rect(Point ptLT,Point ptRD):ptLtTp(ptLT),ptRtDn(ptRD)
    {}
    Rect(int x1=0,int y1=0,int x2=0,int y2=0):ptLtTp(x1,y1),ptRtDn(x2,y2)
    {}
    Rect(Rect &r):ptLtTp(r,ptLtTp),ptRtDn(r,ptRtDn)
    {}
    void disp()
    {
        ptLtTp.disp();
        ptRtDn.disp();
        cout<<endl;
    }
};
int main()
{
    Point p1(3,3),p2(5,5);
    Rect rect1,rect2;
    rect1=Rect(p1,p2);
    rect2=Rect(1,1,4,4);
    rect1.disp();
    rect2.disp();
    Rect rect3(rect2);
    rect3.disp();
    return 0;
}

Rect(Rect &r):ptLtTp(r,ptLtTp),ptRtDn(r,ptRtDn)这一句写错了。

已经解决问题了,这里Rect(Rect &r):ptLtTp(r,ptLtTp),ptRtDn(r,ptRtDn)的两个(r,ptRtDn)写错了,中间符号应该是“.”打成“,”了