0

Inheritance for private member

As far as I know , private embers of base class are not accessible in derived class... I heard (very first time) that private member are inherited , but those are not accessible... is this true? if those are inherited but not accessible, then what is the usecase of this scenario?

30th May 2018, 8:06 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
3 Answers
+ 2
yes it is true thing private members are inherited. here is the code of verification. I have verified by printing the size of object. https://code.sololearn.com/cbOD6FCQxDi8/?ref=app also private members arenot accessible in derived class. it is programmers responsibility to design a robust code and accordingly put a decision to take private data members.
30th May 2018, 9:03 AM
$Ā¢šŽā‚¹š”­!šØš“
$Ā¢šŽā‚¹š”­!šØš“ - avatar
+ 2
Ketan Lalcheta man a big salute to you. You have earned 48k xp in c++.
30th May 2018, 9:10 AM
$Ā¢šŽā‚¹š”­!šØš“
$Ā¢šŽā‚¹š”­!šØš“ - avatar
+ 1
great to know this.... never thought about this anytime before...
30th May 2018, 9:08 AM
Ketan Lalcheta
Ketan Lalcheta - avatar