이 전 글에 디폴트 복사 생성자에 대해서 이야기했다. 멤버 대 멤버에 의한 복사로 '얕은 복사 (shallow copy)라고 한다. 이는 멤버변수가 힙의 메모리 공간을 참조하는 경우에 문제가 됩니다. 얕은 복사에 문제점에 대해서 먼저 이야기 하겠습니다. #include #include #pragma warning(disable:4996) using namespace std; class Person { char* name; int age; public: /*Person() { name = NULL; age = 0; cout name, copy.name); strcpy(this->compeny_name, copy.compeny_name); strcpy(this->phone_number, copy.phone_..