c++ protected 访问限定
class A {
protected:
int mA;
};
class B : public A{
public:
void Func() {
mA = 0; // ok
A *a = this; // failed
a->mA = 0;
}
};
~
class A {
protected:
int mA;
};
class B : public A{
public:
void Func() {
mA = 0; // ok
A *a = this; // failed
a->mA = 0;
}
};
~