What are the differences between public, private, and
protected access?
Answer Posted / prashant kalmodiya
PUBLIC: Specifies that those all members are accessible
from any function.
PRIVATE: Specifies that those members are accessible only
from member functions and friends functions of the class.
PROTECTED: Specifies access to class members in the member-
list up to the next access specifier (public or private)
| Is This Answer Correct ? | 18 Yes | 8 No |
Post New Answer View All Answers
Difference between struct and class in terms of access modifier.
What is the difference between the compiler and the preprocessor?
What is std :: endl?
Can non graphic characters be used and processed in C++?
Is swift faster than go?
Will a catch statement catch a derived exception if it is looking for the base class?
How a new element can be added or pushed in a stack?
When do we run a shell in the unix system?
What is c++ similar to?
What is the difference between the parameter to a template and the parameter to a function?
What is linked list in c++?
What are static variables?
Differentiate between a constructor and a destructor in c++.
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
What is auto used for in c++?