Ed Glass, Gardner, Glass, be so what I want to inherit a glass, be from glass and my index should
be like this glass be then the box.
After that, you will give the access, specify which will be public.
Then the base glass May eight, then you have to give that box and start writing that glass b.
Then you can put that braces end and semicolon.
So it's very similar to inherit all that like functions and variables from A to B.
Just follow this syntax.
OK, now let's see what is the public here mean?
So the public use and access specify it.
OK, so if we want to derive a subclass from a public base class, then the public members of the base
class will become public into the right class, and protected members of the base class will become
that protected members in that drive class.
So we are inheriting something or that class, OK in public law.
We do have to specify s defining, say, the class right.
We have a public God protected our private members in senior class public members that will go to the
public section of that.
IRA Glass, suppose I am having Class E and it's having a lot of public members last year and it's having
a lot of public members.
A, b c, the public members let it be elements for functions, whatever.
If that is inherited to Class B in this public, more than public Class B will contain A and B and C
and that it's public.
OK, so that's it all.
The public must be always going public to that class, speak from me and the disinherited in public.
And if it just having any protective gear must, that will be going to that protected session right
then in protecting the public member and protecting members will be protected.
Everything should really be going to that protected.
And if it is in private, more every members of that protected and public and private, all members
will go to that walk private mode in that class.
So dear, I am glad the CDC had access to private data members.
So that's the thing, and I am glad they cannot get private members of class, which just being in ED.
So it is like bosses having some private members there and not going anywhere.
David Stained-glass excel because they mean we had events, but a private members staff are completely
non accessible because we already started right.
Private members cannot be accessed from anyone except private functions and from glasses.
So even Biden had against private members that not accessible so that private members are not accessible.
That's something we need to take in order.
So, yeah, we have enough explanation here.
I popping 13 is what will happen.
So base closings public, then we are going with public inheritance.
Public numbers will go to public side up that second glass.
If it is like protected inheritance, public members go to that protected site and if it is their private
inheritance, public will go to that private off that derived class.
Similarly protected protected.
If it isn't public inheritance, it will go to protect it.
Protected if it is in case of protected inheritance, it will go to the protected one.
But if it isn't private inheritance, then that protected members will go to that private section.
And if you are doing private, like if you have the private members of the class in three of the inheritance
medals, they are not accessible.
They will not be going to anywhere.
If it isn't based class, they're in private law, it will stay in the base class in that private mode.
It will not be accessible to that date.
IRA Glass.
So now let's move them off the section to understand this concept a little bit more.
So as usual, let's go to our Visual Studio code, and here you have this program created for inheritance.
Yet it will be able to see let me open the dominant.
Let me see if this is the back cover because it's showing some sort of arrows out here.
So let me switch to this first, then try to compile this fire.
C++ in.
I used to have the 10 star KB.
OK, so beginning who instead of including this one, including your stream right now, that is gone
now this is no.
OK, good.
So let me explain this program.
See, you have base class glass bat and a subclass class chain I just inherited in public me.
OK?
And if you see base classes having one public variable, it just entirely underscore B.
That is our native and our classes are also having a public variable.
It discard idea.
Let's go see.
So here you can see child glass is inheriting public plus Fadden right in the public eye glasses inheriting
bad and glass in public, more so as it is public more.
Why do we have started right now, the public member of Class Batten?
Will be going to that Bob Blake section of the last James Whitey and underscore B will be coming out
here along with the and associates in DA, and it will be like this.
You are not writing this car back when you execute the program as this.
This style is inheriting Black Baton.
It will be like this.
B will be also coming up on here.
I'm commending this.
It's not required to add it yet because that asset is inheriting all the public members and here will
be coming our talk here.
Then we are creating our object off that glass and trying to access both valued object 1.80 idea.
And let's go see.
So I am able to access the entire show value that this will show up by watching gaze of the bat and
value items for free from the object off chain.
Is it possible?
Yes, it is possible because because it's inheriting this value.
So even if this card was not there, this in IDB is being coming out here.
So no object of child can access that value and give it value to that.
No, I'm going to find this program.
Hope you have bought that explanation.
See the I to you seven and bad indictees 91.
And how did we access the bad and dirty by using the object of that giant glass?
Because tile classes already already inheriting the Biden bus behind this program?