How can we access protected and private members of a class in C++?
you can access the private members within the class only. private members are hidden from the other classes. and Protected members are only accessible by that class as well as its subclasses only. and public members are accessible by all the classes.