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 is c++ map?

555


What is format for defining a structure?

577


How new/delete differs from malloc()/free?

603


What is c++ vb?

602


What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?

630






Are strings mutable in c++?

686


What are the different types of polymorphism in c++?

581


Can I learn c++ in a week?

568


Why do we use structure in c++?

564


How do you flush std cout?

558


What is the use of map in c++?

597


an operation between an integer and real always yeilds a) integer result b) real result c) float result

699


What problems might the following macro bring to the application?

610


What is the insertion operator and what does it do?

561


What are the syntactic rules to be avoid ambiguity in multiple inheritance?

627