base1和base2继承了base0
myclass继承了base1和base2
/*****************************************************/
#ifndef BASE0_H
#define BASE0_H
class base0{
public:
int x;
base0(int);
};
#endif
base1和base2都继承 base0
/*****************************************************/
#include "base0.h"
base0::base0(int x)
{
this->x = x;
}
/*****************************************************/
#ifndef BASE1_H
#define BASE1_H
#include "base0.h"
class base1 :public base0
{
public:
base1(int);
//继承
};
#endif
/*****************************************************/
#include "base1.h"
base1::base1(int x) :base0(x)
{
//构造函数
}
/*****************************************************/
#ifndef BASE2_H
#define BASE2_H
#include"base0.h"
class base2 :public base0
{
public:
base2(int);
//继承
};
#endif
/*****************************************************/
#include"base2.h"
base2::base2(int x) :base0(x)
{
//构造函数
}
/**************