Difference between c programming and c++ programming in table.


 Here is a table summarizing some of the key differences between C and C++:

FeatureCC++
Object-oriented programmingNot supportedSupported
Classes and objectsNot supportedSupported
InheritanceNot supportedSupported
PolymorphismNot supportedSupported
Operator overloadingNot supportedSupported
Function overloadingNot supportedSupported
NamespaceNot supportedSupported
Exception handlingNot supportedSupported
Standard Template Library (STL)Not supportedSupported
Header filesUsed to declare functions and structuresUsed to declare classes and functions
Main functionMust return an integer valueCan return void or an integer value
Memory managementMust be done manually using functions like malloc() and free()Can be done using new and delete operators or smart pointers
Compatibility with C codeC++ code can be compiled as C code using a C compilerC code may not be compatible with a C++ compiler without some modifications

Note that this is not an exhaustive list and there may be other differences between C and C++ depending on the specific implementation and version of the language.

Post a Comment

Previous Post Next Post