The C language
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4BBhnhTZPG4BURVSOBd3a9JDWpvaOKv6rrdY8fXtBx66tKKgj_ch2E6ZT1QjvB3EDjCTL_1ILX5qTH74d5VyB5JbTUP2CFEAoA0TsHg7tD_VokYLjlpbn_pmp4wfcv-Ar4iEOzB5oIRY/s1600/What+Is+The+Main+Difference+Between+C+and+C%252B%252B+languages.jpg)
Functions contain all the executable code on the C language and the parameters of the functions are passed by value. Pointer values are used when functions parameters are passed by reference. To terminate a statement, semicolon is used.
Following are the characteristics of the C language:
• Ad-hoc run time polymorphism is supported by data and function pointers.
• Reserved keywords are small.
• A wide variety of compound operators such as ++, -=, += etc.
• Conditional compilation, file inclusion of source code and a macro definition preprocessor.
A set of functions are used in C language. Each program in C language is executed in a function called “main function.”
C++ Language
C++ is also a computer programming language. C++ is a high level and object oriented language. C++ is the most commonly used among all programming languages. C++ was developed at Bell Laboratories and it termed as the enhanced version of C language. The features of C++ language include templates, classes, operator overloading and virtual functions. Exception handling and multiple inheritances were also introduced in C++. As compared the C language, more type checking is available in C++.
As it is considered as the enhanced version of C language, most of the features of C language are maintained in C++. Even the C++ compilers are able to run programs created in C. However, some code written in C may be incompatible with C++ compilers.
C++ was originally developed for UNIX system. The code written in C++ is reusable which means that modification can be done in the code without changing it. C++ is portable also which means it is independent of operating system or it does not require specific hardware.
Class is another important feature introduced in C++. The code can be organized with the help of classes. By using classes, bugs can be removed as well as corrected easily.
Difference between C and C++
• C is a procedural programming language whereas C++ is an object oriented programming language.
• C++ introduced the concept of polymorphism, inheritance overloading whereas these are not present in C language.
• Object oriented approach such as objects and classes is used in C++ language.
• Although most of the C programs can be compiled using C++ compilers but still some programs may be incompatible.
Post a Comment