Structure
|
Class
|
Structure
can be defined as a collection of dissimilar data items.
|
Class
can be defined as combination of data items and functionality applied on that
data
|
By
default all members are public
|
By
default all members are private
|
The
size of the structure = size of the individual data items of a structure
|
The
size of the structure = size of the individual data items of a class
|
Separate
copy of data members are created for all structure variables
|
Separate
copy of data members and only one copy of member functions are created for
class
|
To
create a structure variable use keyword struct
|
To
create a class variable the keyword class is optional
|
It
is Not possible to inherit structures
|
It
is possible to inherit class
|
Structure
are called as Passive data item
|
Classes
are called as Active data items
|
Labels: C++