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
Which programming language should I learn first?
Why do we use constructor?
Explain what data encapsulation is in c++?
Explain the benefits of proper inheritance.
Is c++ a pure oop language?
Mention the storage classes in c++.
What do you mean by enumerated data type?
If I is an integer variable, which is faster ++i or i++?
What is java and c++?
What are the uses of c++ in the real world?
What is oops in c++?
Given the following seqment of code containing a group of nested if instructions: y = 9; if ((x==3) || (x == 5)) y++; else if (x == 2) y *= 2; else if (x == ) y-= 7; else y = 8; if the value of x is 4 before the nested IFs are executed, what is the value of y after the nested IFs are executed?
What is the most useful programming language?
What does scope resolution operator do?
What is called array?