A derived class doesn't inherit access to private data members. However, it does inherit a full parent object, which contains any private members which that class declares.
Last 3 mins is a bit confusing. When the jump happens to composition vs. private inheritance. I understand both concepts individually, but couldn't connect the dots Bo is explaining. If someone understands it clearly, do help me in the comment thread.
Hi Bo, Thanks for the video. Could you please explain why cannot I cast D2 to pB. and why this is not 'isa' relationship. I understand D2 is 'protected inheritance', that still has public and protected members of B are protected members of D2. Thanks
Since D_prot D2 is protected of B, why D2.f_pub() is illegal? I thought it could be operated since it is protected and can be derived from the parent class with a public function? Thanks.
Because the base class public and protected member functions get inherited by the base class as protected member functions, and are therefore not able to be called outside of the class...or one of its children. And the main() function doesn't meet either of those two criteria.
I like the old guy appeared at the end of the video; makes me happy!
very clear explanation and good examples!!
A derived class doesn't inherit access to private data members. However, it does inherit a full parent object, which contains any private members which that class declares.
nice effort friend you resolved the problem in just a few minutes thanks alot
Great explanation, great way of narration too
This video gotta great secret point.
Thank you!
Your tutorials are le best.
Last 3 mins is a bit confusing. When the jump happens to composition vs. private inheritance.
I understand both concepts individually, but couldn't connect the dots Bo is explaining. If someone understands it clearly, do help me in the comment thread.
Hi Bo, Thanks for the video. Could you please explain why cannot I cast D2 to pB. and why this is not 'isa' relationship. I understand D2 is 'protected inheritance', that still has public and protected members of B are protected members of D2. Thanks
excuse me, did you mean virtual void function_name more than virtual function_name ?
Thanks..
Since D_prot D2 is protected of B, why D2.f_pub() is illegal? I thought it could be operated since it is protected and can be derived from the parent class with a public function? Thanks.
Because the base class public and protected member functions get inherited by the base class as protected member functions, and are therefore not able to be called outside of the class...or one of its children. And the main() function doesn't meet either of those two criteria.
Thank you. :-)
No sweat.
THANK YOU SO MUCH!
Good lecture!
In class Dog ring_m defaults to what public??
as Peterolen said,
class default is private
struct default is public..
What do you mean by a class's friend?
friend is a special object type that can access private members of a class...
At least how to Inheritance protected! Thanks!
AT LAST
creamofsomeyoungguy?