C++ 이론(5)
·
C++
Inheritance and PolymorphismSeparating Header and Source FileHeader file: properties(속성) & method prototype(메소드 원형)Source file: 메소드 본문 정의 -> 장점: 실제 프로그래밍을 할 때 클래스의 정의를 분리하는 것이 좋음 -> 코드가 무한대로 길어질 수 있기 때문this pointerC++에서는 클래스 멤버르 "id = _id" 이런 식으로 intailized함근데, this pointer를 사용하면 intailized 없이 멤버를 가르키거나 초기화할 수 있음Inheritance(상속)부모 클래스 = 기초 클래스 = base class자식 클래스 = 유도 클래스 = derived classinheritanc..