Nika Soltani Tehrani
A structure is used for handling a group of logically related data(only data) items.
They do not permit data hiding and their members are public by default.
Standard C doesn't allow struct data type to be treated like built-in type.
Class is used to hold data and function both and by default members of class are private.
This work as built-in DT.
structure contain data members only which is by default public.
Data member 1;
Data member 2;
Classes contain data members and member functions also.
Which is by default private.
Classes contain protected member also.
A few days ago I discussed with a friend if it was possible to do object-oriented programming only with structure and function pointers, I think the basics of the concept can be done, but the facilities that the classes have in terms of handling and permissions are a big difference.
Structs are value type whereas Classes are reference type. Structs are stored on the stack whereas Classes are stored on the heap. ... Structs can not have explicit parameterless constructors whereas a class can structs doesn't support inheritance, but classes do.