Private member access specifiers, Protected member access specifiers, Public member access specifiers in OOP C++

Private member access specifiers, Protected member access specifiers, Public member access specifiers in OOP C++

In this tutorial, we will learn about the followings;

What is member access specifier in OOP C++?

What is private access specifier in OOP C++?

What is protected access specifier in OOP C++?

What is public access specifier in OOP C++?

What are member access specifiers?

Members access specifiers are the instructions that controls the access of all members including attributes and functions.

There are 3 types of member access specifiers’

  1. Private
  2. Protected
  3. Public

1.Private access specifier:

Private members are only accessible inside their own class

2. Protected access specifier:

Protected members are accessible within the class and within its derived/child classes.

3. Public access specifier:

Public members are accessible within the class and also outside the class.

How are private protected and public declared within the class?

.

Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....
https://web.facebook.com/groups/2066136233601097/