1.

Explain the difference between class and struct in C++?

Answer»
S.noClassStructure
1.Members of Class are PrivateMembers of Class are Public
2.Declared as ClassDeclared as Struct
3.Used for a more significant AMOUNT of DataUsed for a smaller amount of Data
4.Supports InheritanceDoes not SUPPORT Inheritance
5.The object is created on the Heap memoryThe OBJECTIVE is FORMED on the STACK Memory


Discussion

No Comment Found