What is the difference between Private and Protected in C++??? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 6

What is the difference between Private and Protected in C++???

30th Dec 2016, 4:25 PM
Pravin
Pravin - avatar
2 ответов
+ 5
protected members can be accesed by its derivative classes but private can not.
30th Dec 2016, 4:40 PM
Sandeep Chatterjee
+ 2
Private members are accessible by only the members of same class but protected can be accessed in inherited classes and both can not be accessed outside the class
31st Dec 2016, 7:51 AM
Raj Kumar