What is the difference between Class and Structure?

Answer Posted / vandana mishra

Class is much broader,real world applicable 1-1-1: concept whereas structure is a primitive concept with poor internal organisation.
2: structure contains only data while class bind both data & member functions.
3: class provide data hiding,inheritance etc but structure didn't.
4: if we not define constructor in class there constructor automaticly invoke but in structure it does not happen automaticly.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is empty stack c++?

525


What is scope operator in c++?

569


Please explain the reference variable in c++?

619


What is the precedence when there is a global variable and a local variable in the program with the same name?

642


what are function pointers?

582






What is the use of class in c++?

572


Is c++ free?

586


What are references in c++?

668


Explain unexpected() function?

590


How does code-bloating occur in c++?

756


What is increment operator in c++?

564


Is c++ a low level language?

519


Explain overriding.

611


Differentiate between late binding and early binding. What are the advantages of early binding?

586


Write about the retrieval of n number of objects during the process of delete[]p?

576