You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.
C++ 继承
面向对象最重要的是继承,继承允许依据一个类定义另一个类。
基类 派生类
基类,以有的类称为基类。
派生类,根据基类派生出的类称为派生类。
访问控制和继承
派生类可以访问基类中的非私有成员。
一个派生类,继承了基类的所有方法。
下列的除外
继承类型
公有继承,类派生自公有基类时,基类的公有成员为派生类的公有成员。基类的保护成员为派生类的保护成员。基类的私有不能被派生类访问,通过基类的公有和保护成员访问。
保护继承,一个类派生自保护基类时,基类的公有和保护成员将成为派生类的保护成员。
私有继承,一个类派生自私有基类时,基类的公有和保护成员,将成为派生类的私有成员。
The text was updated successfully, but these errors were encountered: