Class Base() { protected: void foo(); } Class Derived : public Base { void bar(); } void Derived::bar(){ foo(); //this causes an error. }
我知道我可能错过了一些明显的东西,但我已经绕圈了一个小时.如何在派生类中调用受保护的函数?
c++ inheritance
c++ ×1
inheritance ×1