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 srand c++?
Why is standard template library used?
Should I learn c or c++ or c#?
How do I run c++?
What are the benefits of oop in c++?
What are the advantages of c++?
Define upcasting.
Is c++ still in demand?
How would you implement a substr() function that extracts a sub string from a given string?
If a function doesn’t return a value, how do you declare the function?
What are the restrictions apply to constructors and destructors?
What is an adaptor class in c++?
write a function signature with various number of parameters.
What do you mean by friend class & friend function in c++?
What is an html tag?