Write about the access privileges in c++ and also mention about its default access level?



Write about the access privileges in c++ and also mention about its default access level?..

Answer / Nikhil Verma

In C++, access levels define how external entities can interact with class members. There are three levels: `public`, `private`, and `protected`. By default, all members of a class are private if no access level is specified.n Example: `class MyClass { private: int myPrivateVariable; };`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Implement strcmp

3 Answers   Bloomberg, Citadel,


You want to link a c++ program to c functions. How would you do it?

1 Answers  


can anybody please tell me how to write a program in c++,without using semicolon(;)

6 Answers   NIIT,


Which function cannot be overloaded c++?

1 Answers  


What is namespace std; and what is consists of?

1 Answers  


Can member data be public?

1 Answers  


What is time_t c++?

1 Answers  


Why can templates only be implemented in the header file?

1 Answers  


Const char *p , char const *p What is the difference between the above two?

1 Answers   TCS,


Explain the difference between c++ and java.

1 Answers  


Do inline functions improve performance?

1 Answers  


What are keywords in c++?

1 Answers  


Categories