c++ protected 访问限定

class A {

protected:

int mA;

};

class B : public A{

public:

void Func() {

mA = 0; // ok
A *a = this; // failed

a->mA = 0;

}

};
~

原文地址:https://www.cnblogs.com/niukuo/p/6265612.html