Differentiate between protected .and private me~bers of a class. in context of Object Oriented Programming. Also, give a suitable example illustrating accessibility/non-accessibility of each using a class and an object in C++.
Protected Member: Protected Members are the members that can be used only by member functions and friends of the class in which it is declared. The protected members are similar to private members that they cannot be accessed by non-member functions.Protected members are inheritable but private members are non-inheritable.
Private Members: Private Members are the class members that are hidden from the outside world. The private members implement the OOP concept of data hiding. The private members of a class can be used only by member functions (and friends) of the class in which it is declared.