class Child : public Parent
{
public:
Child(Child& rhs) : Parent(rhs);
};
Child operator =(const Child& rhs)
{
....
Operator::operator =(rhs);
}
위의 문장으로 충분할까?
class 에서 유지보수로 인한 맴버변수 추가가 이루어 졌을 때 위의 코드처럼 자식클래스에서 부모클래스를 초기화 하는 코드를 꼭 넣자
주요 사항은 생성자(복사), 소멸자, operator 연산자