Vidyalelo
C++ Programming · Q23

Object Oriented Programming in C++

Programming · C++ Programming · question 23

Q23

What is the difference between 'struct' and 'class' in C++?

A.
The default access level of members in a struct is public, while in a class, it is private
B.
Classes allow inheritance, while structs do not
C.
Structs have all members public by default, while classes have them private by default
Answer
D.
Structs are used for inheritance, while classes are not

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board