#include
using namespace std;
class A
{
public:
int x;
int y;
int z;
void print()
{
cout<<"A中的函数"<
}
};
class B:public A
{
public:
int x;
int m;
int n;
void print()
{
cout<<"B中的函数"<
}
};
class C:public B
{
public:
int x;
};
int main()
{
/* B b;
cout<<"&b.x="<<&b.x<
cout<<"&b.A::x="<<&b.A::x<
cout<<"&b="<<&b< b.x=100;
b.A::x=200;
b.print();
b.A::print();*/
C c;
c.x=10;
c.A::x=20;
c.B::x=30;
cout<<"&c.x"<<&c.x<
cout<<"&c.A::x"<<&c.A::x< cout<<"&c.B::x"<<&c.B::x<
}
阅读(604) | 评论(0) | 转发(0) |