The class Point
{
Public:
Void your setX (int x)
{m_X=x; }
Int getX ()
{return m_X; }
Void setY (int y)
{m_Y=y; }
Int getY ()
{return m_Y; }
Private:
Int m_X;
Int m_Y;
};
//round
The class Cricle
{
Public:
Void setR (int r)
{
M_R=r.
}
Int getR ()
{
Return m_R;
}
Void setCenter (Point center)
{
M_Center=center; //error: there is no from the "point" to "int" appropriate conversion function
}
Point getCenter ()
{
Return m_Center; //error: there is no from the "point" to "int" appropriate constructor
}
Private:
Int m_R;
Center Point m_Center:// an error: the type of a domain is invalid
};
Follow the teacher copy write code, the above problems, how to solve? Turn to for help
CodePudding user response:
1. Realize the point's default constructor2. Implement point=operator
CodePudding user response:
Thank you thank youJust to debug and successful,