What is the access specifier in C++?

What is the access specifier in C++?

Access specifier in C++ :

-The access specifiers are used to define how to functions and variables can be accessed outside the class.

-There are three types of access specifiers: 

1. Private: Functions and variables declared as private can be accessed only within the same class, and they cannot be accessed outside the class they are declared. 

2. Public: Functions and variables declared under public can be accessed from anywhere.

3. Protected: Functions and variables declared as protected cannot be accessed outside the class except a child class. This specifier is generally used in inheritance.

Read More →
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!