Comparison
between Structure and Class:
▪
Structure and class are user defied data types
▪
By default, structure is a public whereas class is private
▪
Class implements the principal of encapsulation
▪
Objects of a class are created on the heap memory
▪
Class is used for re usability whereas structure is used for
grouping the data in the same structure
▪
Structure data members cannot be initialized directly but they
can be assigned by the outside the structure
▪
Class data members can be initialized directly by the parameter
less constructor and assigned by the parameterized constructor.
Post a Comment
Don't Forget To Join My FB Group VU Vicky
THANK YOU :)