생성자를 사용해 멤버 초기화를 할 수 있다. #include using namespace std; class Point { int xpos; int ypos; public: Point(int x, int y) { xpos = x; ypos = y; } int Getx() { return xpos; } int Gety() { return ypos; } }; class Rectangle { Point point1; Point point2; public: Rectangle(int x, int y) :point1(x, y), point2(y, x) {} void Showinfo() { cout