class Derived : public Base { protected: int d; public: void DoSomething() { b+=this->b; d=0; } }; //this will work