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
Is c++ the hardest programming language?
What is the use of main function in c++?
What are the uses of static class data?
Is c++ vector dynamic?
Distinguish between new and malloc and delete and free().
Tell me can a pure virtual function have an implementation?
What is the difference between an array and a list?
How do I use turbo c++?
How to tokenize a string in c++?
What is null pointer and void pointer?
Describe the setting up of my member functions to avoid overriding by the derived class?
When to use “const” reference arguments in a function?
What are the various compound assignment operators in c++?
How do I exit turbo c++?
Define pre-condition and post-condition to a member function in c++?