What is the difference between Class and Structure?
Answer Posted / prince rupela
1.Structure is Value Type. Class is a reference type.
2.Structure Contain Data Member. Class Contain Data Member And Member Function.
3.In Structure Data Members are By Default Public. In Class Data Member are By Default Private
4.Structure can not Inherit. Structure can Inherit.
5.There is no Data Hiding Feature in Structure. In Class There is Data Hiding features like Public,Private, Protected.
6.A Structure Can't Abstract . Class can.
7.Structure both use c and c++. class only c++ and oops language.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is constructor and destructor in c++?
Can c++ be faster than c?
What is helper in c++?
What are iterators in c++?
what is data abstraction in C++?
Is there finally in c++?
How the delete operator differs from the delete[]operator?
What is the difference between while and do while loop? Explain with examples.
What does #define mean in c++?
State the difference between delete and delete[].
What is an operator function? Describe the function of an operator function?
What sorting algorithm does c++ use?
Is atoi safe?
Explain the difference between using macro and inline functions?
Differentiate between a constructor and a method in C++.