What is private, protected and public access specifier in cpp, explain with example?
1 Answers
class chetan
{
   private:
   ……
   protected:
   ……
   public:
   ……
};
- The private access specifier is only visible to member functions within its class.
- The protected access specifier is only visible to member functions of its own and derived class.
- The public access specifier is only visible to all functions in the program.