Accessing private and protected members

How can we access protected and private members of a class in C++?


1 Answer
1-1 of  1
1 Answer
  • 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.
    1

c plus plus programming
Practice Mock Test
c plus plus programming