c++ protected inheritance | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

c++ protected inheritance

In the code below, what becomes protected members (x and y variables) of parent class in the derived class? private,public or protected? https://code.sololearn.com/ccc58BvegKxe

13th Feb 2019, 1:00 PM
okan
okan - avatar
2 Answers
+ 1
Protected members of class A can be assessed by class B Protected variable can be assessed by child class but not only visible by world
13th Feb 2019, 1:09 PM
Mr Robot
Mr Robot - avatar
0
I think I couldn't ask cleanly. I mean, for example public members of base class becomes private members of derived class inherited by private keyword. Then what happens by using protected keyword?
13th Feb 2019, 5:52 PM
okan
okan - avatar