定义派生类格式
class 派生类名:继承方式 基类名
{
派生类函数;
派生类数据;
}
继承方式:public protected private 设置成员被访问权
限,能被那些对象操作
举例:
- class Cfather
-
{
-
public:
-
void fatherskin();
-
private:
-
int age;
-
}
-
-
class Cchild:public Cfather //public 继承方式
-
{
-
public:
-
void childskin();
-
private:
-
char ***;
- }