Multiple choice

Which of the following statements show(s) the difference between the class and structure in C++?

  1. A class is user-defined data type in C++, whereas a structure is not.

  2. A class has private access specifier by default, whereas a structure has protected access specifier in C++.

  3. A class has private access specifier by default, whereas a structure has public access specifier in C++.

  4. Both (1) and (3)

  5. Both (2) and (3)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

This statement is true about class and the structure in C++ and this is the only difference between them.