Skip to main content

What are the differences between a C++ struct and C++ class?

Comments

Achyut said…
The only formal difference between class and structure is that in a class the members are private by default, while in a structure they are public by default.

It is good to use Structre for data,classes for both datamembers and memberfunctions.