You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The age member of the Base class is public, so it can be accessed directly from an object of the Base class. However, when
17
+
it comes to the Derived class, which inherits from Base, the age member is not directly accessible because the inheritance is private by default in C++.
In C++, if you do not specify an access specifier (`public`, `protected`, or `private`) when declaring a derived class, the inheritance is `private` by default.
26
+
This means that public and protected members of the base class become private members of the derived class.
0 commit comments