/* 4. ´ÙÀ½ ÇÁ·Î±×·¥ÀÇ Ãâ·ÂÀ» ½á¶ó. */ #include int data[5] = { 1, 2, 3, 4, 5 }; // ¿©±â¸¦ ¹Ù²Ü °Í class Str { public: char *s; Str() { s = NULL; } Str(char* s) { printf("%d\n",data[0]); } ~Str() { printf("%d\n",data[1]); } Str& operator+(char* s) { printf("%d\n",data[2]); return *this; } Str& operator+(Str& s) { printf("%d\n",data[3]); return (*this + s.s); } void operator=(Str& s) { printf("%d\n",data[4]); return; } }; void main() { Str x("kim"); Str y = x; x = x + y + "kim"; }