What is the difference between class and structure?

What is the difference between class and structure?

Diff b/w Class and Structure is : 
Class is difined as-
>Class is a successor of Structure. By default all the members inside the class are private.
>Class is the advanced and the secured form of structure.
>Classes are refernce typed.
>Class can be inherited.
>In Class we can initilase the variable during the declaration.
>Class can not be declared without a tag at the first time.
>Class support polymorphism.
Structure difine as :
> In C++ extended the structure to contain functions also. All declarations inside a structure are by default public.
> Structures contains only data while class bind both data and member functions.
> Structure dosen't support the polymorphism, inheritance and initilization.
> Structure is a collection of the different data type.
> Structure is ovrloaded.
> Structures are value type.
> Structure can be declared without a tag at the first time

By:UMANG
Date:2030-12-08 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related C Subjective Links

C Subjective interview questions and answers for experienced and fresher