mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
[C++/en] Small inheritance clarification
Clarified that private members are inherited but are not directly accessible
This commit is contained in:
parent
8592f26199
commit
e32eb715ef
@ -404,6 +404,8 @@ int main() {
|
||||
// Inheritance:
|
||||
|
||||
// This class inherits everything public and protected from the Dog class
|
||||
// as well as private but may not directly access private members/methods
|
||||
// without a public or protected method for doing so
|
||||
class OwnedDog : public Dog {
|
||||
|
||||
void setOwner(const std::string& dogsOwner);
|
||||
|
Loading…
Reference in New Issue
Block a user