What is the difference between Class and Structure?
Answer Posted / mohanraj.d
1.structure is a value type.but class is a reference type.
2.structure is stored in stack.but class is stored in heap.
3.struct cannot have default constructor.
4.struct do not support inheritance.
5.class can inherit from a class.
6.struct cannot have declare destructor.
7.class has define object and function.
8.structure has define only object.
Is This Answer Correct ? | 50 Yes | 28 No |
Post New Answer View All Answers
What is a set in c++?
Which software is best for coding?
What do manipulators do?
What is a linked list in c++?
What is increment operator in c++?
What is difference between n and endl in c++?
What is static class data?
What is c++ w3school?
What is constructor in C++?
What are keywords in c++?
What are friend classes? What are advantages of using friend classes?
What is private, public and protected inheritance?
What is a block in c++?
What is a constant reference?
Do the parentheses after the type name make a difference with new?