Public inheritance... Private members?
Assuming I have two classes, the base containing a private member variable and the other class being derived from base, what is stopping me from accessing that private variable as a member inside of the derived class?
g++ gives me:
'int base::variable' is private
within this context
Re: Public inheritance... Private members?
Re: Public inheritance... Private members?
OK... makes enough sense, I suppose that private members are really only for the implementation of the actual derived class, so that's where they should be put. Thanks a lot :D
Re: Public inheritance... Private members?
Use protected instead, that is why it is there.