Class Revisited
C++ language not just supports the access specifiers private and public, but also a very important access specifier, protected, that is significant in class inheritance. Since far as the access limit is concerned, inside a class or from the objects of a class, protected access-limit is similar as that of the private specifier. Moreover, the protected specifier has a prominent role to play in inheritance. class could use all the three visibility modes as described below:
Class classname
{
private:
...... // Visible to member functions inside
...... // its class but not in derived class protected:
...... // Visible to member functions inside its
...... //class and derived class
public:
}
...... //visible to member functions inside
...... //its class, derived classes and by objects