What is the difference between class and structure?

Answer Posted / arvind

The main difference is
Structure ... Class
struct . Class
{ . {
data members ... data members
} ... +
... Member functions
... }

We can't define Functions inside structure where as in class we can define inside

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the benefits of interface?

678


How oops is better than procedural?

675


Whats is abstraction in oops?

702


What is object in oop with example?

821


Advantage and disadvantage of routing in telecom sector

872






What is polymorphism and its types?

691


What is the problem with multiple inheritance?

686


What is encapsulation in simple terms?

638


Where You Can Use Interface in your Project

1506


What is abstraction in oops with example?

874


What is abstraction in oop with example?

742


What is the fundamental idea of oop?

737


What are properties in oop?

695


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1750


What is encapsulation oop?

672