Different between Class and Structure in C++
Class |
Structure |
Class is
defining using keyword class. |
Structure
is defining using keyword structure. |
Class is
a collection of data member and member function. |
Structure
is a collection of data variables. |
Class member
are private by default. |
Structure
member are public by default. |
Class
can be inherited. |
But
structure can’t be inherited. |
It takes
more space. |
It takes
less space. |
0 Comments