The differences between a
class and a
struct in C++ is:
structmembers and base classes/structs are
classmembers and base classes/struts are
Both classes and structs can have a mixture of
private members, can use inheritance and can have member functions.
I would recommend you:
structfor plain-old-data structures without any class-like features;
classwhen you make use of features such as
protectedmembers, non-default constructors and operators, etc.