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
If a function doesn’t return a value, how do you declare the function?
program explaining feautures of c++
Can constructor be static in c++?
What is the meaning of string in c++?
Why do we need templates?
What are structures and unions?
What is a singleton class c++?
What is an inline function in c++?
What is double in c++?
How does work in c++?
Refer to a name of class or function that is defined within a namespace?
Why null pointer is used?
What are the 2 main types of data structures?
Does dev c++ support c++ 11?
Can I uninstall microsoft c++ redistributable?