Difference between "C structure" and "C++ structure".

Difference between "C structure" and "C++ structure".

Many diff are there : 
>Structure in C defines as limited to within the module and cannot be initialized outside but Structure in C++ can initialize the objects anywhere within the boundaries of the project.
> C++ have a many methods((Procedures) but in C no methods are there.
> By default C structure are Public and  C++ structure are private .
> C does not support Methods inside structure but C++ does.
> In C++ structure we can add functions but in C 
structure we can't.
> In C++, structure behaves like class like can add function, and can use properties on class as inheritance, virtual,etc, But in C, structure we can have only data member but not functions.
> Structures in c++ doesnot provide datahiding but a class provides.
> classes support polymorphism, But Structures don't.

By:Umang
Date:2031-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