// 생성자에대해서..
// 1. 생성자의모양, 언제호출되는가?
// 2. 생성자를1개도만들지않으면컴파일러가기본생성자1개를제공한다.
#include <iostream>
using namespace std;
class Point
{
private:
        int x;
        int y;
public:
        Point()                       // 1
        {
               Point(0, 0);   // 생성자에서다른생성자호출!!
               x = 0;
               y = 0;
               cout << "Point()" << endl;
        }                                     
        Point( int a, int b ) { x = a; y = b; }     // 2
};
class Rect
{
        Point p1;
        Point p2;
public:
        Rect()
        {
               cout << "Rect()" << endl;
        }
};
void main()
{
        Rect r; // ?
        Point* p5;             // 객체가아니라포인터이다. 생성자호출안됨
        Point* p6 = (Point*)malloc( sizeof(Point) ); //생성자호출안됨.
        Point* p7 = new Point; // 생성자호출
        Point p;
        //p.Point();           // 생성자의명시적호출은안된다.!!!
        Point p3[10];  // 1번생성자를10번호출
        Point p4[5] =
         { Point(1, 2), Point(2, 3) };  // 2번생성자2번, 1번생성자3번호출
        Point p1;
        Point p2( 1, 2 );
}