Difference between C and C++
What is C?
C is a programming language developed at AT &T’s Bell laboratories of USA by Dennis Ritchie. Soon many people began to use C instead of other languages such as FORTRAN,ALGOL etc.C became so popular because it was simple,reliable and easy to use.C falls in middle level language which is in between High level languages or Problem oriented language and Low level or Machine oriented languages.
What is C++?
C++ was developed by Bjrane Stroustrup at AT &T’s Bell laboratories of USA. Stroustrup wanted to develop an object-oriented programming language with the features of C.As a result C++ was born.In 1983 Rick Mascitti coined the term C++.
Difference between C and C++
- C is function-oriented language and C++ is object-oriented.
- C uses top to bottom approach while C++ uses the bottom to top approach.
- In C, we cannot give same name to a function and in C++ more than one function can be created if the parameters or arguments are different which means that function overloading is absent in C.
- Data hiding concept is absent in C which means that Data is not protected in C whereas data is protected in C++.
- C uses printf() and scanf() functions to write and read data while C++ uses cout and cin objects for these operations.
- Constructors and destructors are not present in C.
- C does not have namespace feature which avoid name collisions.
- C does not support friend functions which is supported in C++.
Comments
Post a Comment