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
Can we define function inside main in c++?
When you overload member functions, in what ways must they differ?
How does c++ structure differ from c++ class?
How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?
What is the outcome of cout< a) 16 b) 17 c) 16.5
How do you traverse a btree in backward in-order?
what is upcasting in C++?
Does c++ support multilevel and multiple inheritances?
What is using namespace std in cpp?
What does iomanip mean in c++?
What is c++ used for in games?
How to give an alternate name to a namespace?
What is the best c++ compiler?
Is it possible to write a c++ template to check for a function's existence?
What is pure virtual function?