목록다중상속 (1)
배움 저장소
[홍정모의 따라하며 배우는 C++] 11. 상속
11.1 상속의 기본 (1) Derived Class(상속받은 객체)는 Generalized Class(상위 객체)의 인스턴스를 멤버를 가지고 있다 class Mother { private: int m_i; public: int& getValue(){ return m_i; } void setValue(int i){ m_i = i; } }; class Child: public Mother {}; int main(){ Mother mom; mom.setValue(45); cout
Programming Language/C++
2021. 12. 27. 22:27