Base & Derived クラスがあるとします。
class Base{
private:
int* _privateIntPtrB;
protected:
int* _protectedIntPtrB;
public:
//methods which use
//_privateIntPtrB and _protectedIntPtrB
class Derived: public Base{
private:
int* _privateIntPtrD;
protected:
int* _protectedIntPtrB; //I am redeclaring this var
public:
//methods which use
//_privateIntPtrD and _protectedIntPtrB
私の質問: クラスのメソッドでDerived
は、派生バージョンが_protectedIntPtrB
使用されますか? (あると思いますが、確認したいです)。
メソッドがクラスによって再定義されない場合、クラス へのポインターによって使用されるDerived
のはどのバージョンですか?_protectedIntPtrB
Derived
私が尋ねている理由 -クラスで別_protectedIntPtrB
の方法で初期化し、派生クラスのすべてのインスタンスでDerived
そのバージョンを使用したい。_protectedIntPtrB