1.

What is the difference between struct and class?

Answer»

In C++ a structure is the same as a class EXCEPT for a few differences like SECURITY. The DIFFERENCE between struct and class are given below:

StructureClass
Members of the structure are public by DEFAULT.Members of the class are private by default.
When deriving a struct from a class/struct, default ACCESS specifiers for base class/struct are public.When deriving a class, default access specifiers are private.


Discussion

No Comment Found