c++ protected inheritance | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 Réponses
+ 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
Saad Mughal
Saad Mughal - 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