#include<iostream>
#include<string>
using namespace std;
class Base {
public:
Base()
{
m_A = 1000;
}
int m_A;
};
class Base1 {
public:
Base1()
{
m_A = 2990;
}
int m_A;
};
//多继承语法 class 子类名 :继承方式 父类名1,继承方式 父类名2
class Son :public Base, public Base1 {
public:
Son()
{
m_C = 100;
m_D = 299;
}
int m_C;
int m_D;
};
void test()
{
Son s;
cout << "son m_C=" << s.m_C << endl;
cout << "son m_D =" << s.m_D << endl;
cout << "Base m_A=" << s.Base::m_A << endl;
cout << "Base1 m_A=" << s.Base1::m_A << endl;
}
int main()
{
test();
}