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
What is difference between n and endl in c++?
Explain all the C++ concepts using examples.
Describe linkages and types of linkages?
Where and why do I have to put the "template" and "typename" keywords?
Difference between class and structure.
What is #include c++?
What is the main purpose of overloading operators?
What are disadvantages of pointers?
What is the maximum value of a unsigned char a) 255 b) 256 c) 128
Explain what you mean by a pointer.
Explain the operation of overloading of an assignment operator.
What is object oriented programming (oop)?
How can you link a c program with a c function?
Define vptr.
How a new element can be added or pushed in a stack?