Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Keyword for setting class access level to protected (the other access levels are private and public) or for protected inheritance.
class Base
{
};
{
void ResetX() { m_x = 0; } //For a derived class (only) m_x is public
};
{
Base b;
b.m_x = 0; //Not allowed! Only derived classes have access to Base::m_x
}
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.