What is the difference between Class and Structure?

Answer Posted / ramesh.alavala

class provides data hiding,structures doesn't provide.
class support polymorphism,structures doesn't support.
classes by default are inherited by privately,structures are
inherited by publicly.
classes can be abstract, structures can't be abstract.

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does flush do?

557


What is setf in c++?

577


What is the array and initializing arrays in c++?

506


Why can’t you call invariants() as the first line of your constructor?

553


What is the use of class in c++?

568






Why is swift so fast?

618


Can a list of string be stored within a two dimensional array?

573


What is the type of this pointer in c++?

630


What is one dimensional array in c++?

577


Define linked lists with the help of an example.

552


How do I make turbo c++ full screen?

583


Is c++ an integer?

577


What is polymorphism & list its types in c++?

621


What are the methods of exporting a function from a dll?

648


Why is it called c++?

581