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