Current post is on difference between Class and Structure in C++ language.
Difference:
Struct:
- By default access is public
Class :
- By default access is private
It means when:
- member variable is declared
- member function is declared
- It is derived
and one does not specific the access specifier, it will get defaulted to mentioned access specifier
Structure Key Points:
- Struct can have member functions.
- Struct can be derived.
- Struct can have polymorphic behavior.
Appreciate your feedback via comments. Thanks.
No comments:
Post a Comment