Difference between struct and class in terms of access modifier.



Difference between struct and class in terms of access modifier...

Answer / Rahul Jain

By default, members of a C++ class are private, while members of a struct are public. This means that the data members of a class must be explicitly declared as public, protected, or private, but the data members of a struct have the same access level as their containing scope unless explicitly modified.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

How do you print a string on the printer?

1 Answers  


Define macro.

1 Answers  


What is the basic of c++?

1 Answers  


What is the difference between function overloading and operator overloading?

1 Answers  


What is the limitation of cin while taking input for character array?

1 Answers  


Is it possible to write a c++ template to check for a function's existence?

1 Answers  


How can you create a virtual copy constructor?

1 Answers  


Which software is used to run c++ program?

1 Answers  


How to create a pure virtual function?

1 Answers  


What is an arraylist c++?

1 Answers  


Are vectors faster than arrays?

1 Answers  


Define linked lists with the help of an example.

1 Answers  


Categories