Hi Guys,
I wanted to know about access specifier,if we have a class of "Teacher" as given below and its data members are protected, will
the child class "Student" be able to access the protected data members of the base class "Teacher" even if we make it private inheritance as:
class Student : private Teacher
----------------------------------------------------------------------------
-----------------------------------------------------------------------------Code:class Teacher { protected: int age; public: bool SetAge(int_age) { if(_age>=0 && _age<=125) { age =_age; return true; } return false; }; class Student: private Teacher { public: boolSetAge(int_age) { if(_age>=18 && _age<=25) { age = _age; return true; } return false; } };