Explain the different access specifiers for the class member in c++.
Answer / Isha Vishnoi
In C++, there are three different access specifiers for class members: public (default), private, and protected. Public members can be accessed from anywhere including within the class, outside the class, or even by a derived class. Private members can only be accessed from within the same class they were declared in, but not from outside the class or derived classes. Protected members are similar to private members but can also be accessed by a derived class.
| Is This Answer Correct ? | 0 Yes | 0 No |
Give 10 points of differences between C & C++.
Why is main an int?
What is std::move?
Why namespace is used in c++?
What are the comments in c++?
Write a program in c++ to print the numbers from n to n2 except 5 and its multiples
Where are setjmp and longjmp used in c++?
Write a program to calculate the BMI of a person using the formula BMI = weight/height2.
advantages and disadvantages of using Borland C++ / version 5.
What is Pure Virtual Function? Why and when it is used ?
Is c the same as c++?
What is enum c++?