What is the difference between Class and Structure?
Answer Posted / sudip das.
The difference between a CLASS and STRUCTURE are that:
1) CLASS are reference type where as STRUCTURE are value type.
2)By default,all of the members of a CLASS are private, but all of the members of a STRUCTURE are public.
3)CLASSES use heap but STRUCTURE use stuck.
4)CLASS members can be declared as protected but STRUCTURE members can not be.
5)CLASS contain data members and member function, but a STRUCTURE is contain only data member.
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
How can you quickly find the number of elements stored in a static array?
Can we get the value of ios format flags?
Does c++ have foreach?
What is class definition in c++ ?
What is meant by the term name mangling in c++?
What are containers in c++?
Do you know about C++ 11 standard?
Tell me an example where stacks are useful?
What is functions syntax in c++?
Why do we use iterators?
If all is successful, what should main return a) 0 b) 1 c) void
What is general format for a prototype?
How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?
What is #include cmath?
Comment on assignment operator in c++.