#include<iostream>
class Base{
public:
Base(){
m_A=100;
}
void func(){
std::cout<<"base func"<<std::endl;
};
int m_A;
};
class Son:public Base{
public:
Son(){
m_A=200;
}
void func(){
std::cout<<"son func"<<std::endl;
}
int m_A;
};
void test_func(){
Son x;
std::cout<<"Son "<<x.m_A<<std::endl;
std::cout<<"Base "<<x.Base::m_A<<std::endl;
x.func();
x.Base::func();
}
int main(){
return 0;
}
标签:std,cout,继承,成员,同名,Base,func,void From: https://www.cnblogs.com/gishuanhuan/p/18106867