
복사 생성자 인스턴스의 사본을 만드는 것. 만약 들고 있는 것이 레퍼런스라면, 레퍼런스의 주소값을 복사해줄 것인지의 문제가 있다. // Vector.h class Vector { public: Vector(const Vector& other); private: int mX; int mY; }; // Vector.cpp Vector::Vector(const Vector& other) : mX(other.mX) , mY(other.mY) // private 이지만, 같은 class 이기 때문에 접근 가능하다. { } 같은 클래스의 다른 개체를 이용하여 새로운 개체를 초기화하는 것은 다음과 같다. Vector(const Vector& other); Vector a; // default constructor 또..