Welcome to graduate2professional.blogspot.com

Wednesday, November 11, 2009

Difference between "C structure" and "C++ structure"?

1.The defination of the structure in C is limited to within the module and cannot be initialized outside its scope. Where as in C++ you can initialize the objects anywhere within the boundaries of the project.
2. By default C structure members are Public and C++ structure members are private.
3. C does not support Methods inside structure but C++ does.
4. In C++ structure we can add functions but in C structure we can...t.
5. 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.

No comments:

Post a Comment