파생클래스derived class1 C++ 상속inheritance, derived class, 오버라이드(overriding) - Power C++ p565 LAB 상속inheritancederived class 선언class 파생 클래스 명 : 접근 지정자 기본 클래스 명{파생 클래스에 추가할 멤버 선언}; 클래스의 큰 장점인 '상속(inheritance)' '캡슐화(Encapsulation)' '다형성' protected : 파생클래스의 함수에서 기본 클래스의 protected멤버에 접근할 수 있다. 상속방법:class Student : public Human 기본 클래스의 public 멤버 -> 파생 클래스의 public 멤버기본 클래스의 protected멤버 -> 파생 클래스의 protected멤버기본 클래스의 private멤버 -> 파생 클래스의 private멤버 멤버 함수 오버라이드오버라이드(overriding) : 파생 클래스의 함수가 기본 클래스의 함.. 2019. 1. 17. 이전 1 다음