A private member variable or function cannot be accessed, or even viewed from outside the class. Only the class and friend functions can access private members.
A private member variable or function cannot be accessed, or even viewed from outside the class. Only the class and friend functions can access private members.
A protected member variable or function is very similar to a private member but it provides one additional benefit that they can be accessed in child classes which are called derived classes.
Public members are members of a class that can be accessed by any function in the program.