/* 2. ´ÙÀ½ ÇÁ·Î±×·¥ÀÇ Ãâ·ÂÀ» ½á¶ó. */ #include int number[5] = { 1, 2, 3, 4, 5 }; // ¿©±â¸¦ ¹Ù²Ü °Í class Point2D { public: int x; int y; Point2D(int a,int b) { x = a; y = b; } void foo(Point2D p,Point2D &q) { x = p.x; p.x = 100; y = q.y; q.y = 100; } void print() { printf("%d %d\n",x,y); } }; void foo(Point2D &p) { p.x = p.y = 0; } void main() { Point2D x(number[0],number[1]); Point2D y(number[2],number[2]); Point2D z(number[3],number[4]); y.foo(x,z); foo(x); foo(z); x.print(); y.print(); z.print(); }