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
Will rust take over c++?
Explain the static storage classes in c++.
Which header file allows file i/o with streams a) fileio.h b) iostream.h c) fstream.h
What are features of c++?
What are abstract data types in c++?
What is the need of a destructor? Explain with the help of an example.
Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)
What is lazy initialization in c++?
Why is polymorphism useful?
Is python better than c++?
What are the types of array in c++?
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?
What programming language should I learn first?
Define the process of handling in case of destructor failure?
What are stacks?