访问派生类中的受保护成员
class Base{
protected:
int b;
public:
void DoSomething(const Base& that)
{
b+=that.b;
}};class Derived : public Base{
protected:
int d;
public:
void DoSomething(const Base& that)
{
b+=that.b;
d=0;
}};DoSomethingBaseDerivedthat.bDerivedcannot access protected member
bb
慕莱坞森
慕码人2483693
杨魅力
白衣染霜花
随时随地看视频慕课网APP
相关分类