Difference Between C and C++ Programming Languages(C vs C++)
{tocify} $title= {Table of Contents}
What is C Programming Language?
C is a structural or procedural oriented programming language which is portable and used in various applications. C was developed by Dennis Ritchie at AT & T Bell Laboratories. C is the basic programming language that can be used to develop from the operating systems (like Windows) to complex programs like Oracle database, Git, Python interpreter, and many more. C programming language is the base for other programming languages. If we know the C language, then we can easily learn other programming languages. It contains some additional features that make it unique from other programming languages.
What is C++ Programming Language?
C++ is an object-oriented programming language. It was developed by Bjarne Stroustrup at AT&T Bell Laboratories in Murray Hill, New Jersey, USA, in the early 1980’s. Stroustrup, an admirer of Simula67 and a strong supporter of C, wanted to combine the best of both the languages and create a more powerful language that could support object-oriented programming features and still retain the power and elegance of C. The result was C++. Therefore, C++ is an extension of C with a major addition of the class construct feature of Simula67. Since the class was a major addition to the original C language, Stroustrup initially called the new language ‘C with classes’. However, later in 1983, the name was changed to C++. The idea of C++ comes from the C increment operator ++, thereby suggesting that C++ is an augmented version of C. C+ + is a superset of C. Almost all C programs are also C++ programs. However, there are a few minor differences that will prevent a C program to run under C++ complier. We shall see these differences discussed in this article.
Difference Between C and C++ Programming Languages
- C follows procedural style programming and C++ is follows both procedural and object oriented programming.
- C follows top-down approach and C++ follows bottom-up approach.
- C does not support function overloading but C++ support function overloading.
- C does not support referenced variable but C++ support reference variable.
- In C printf(), scanf() is used for get input, output but in C++ cin and cout is used for getting input and output operations.
- Operator overloading is not use in C but Operator overloading is use for C++.
- In C Programs are divided into Procedures and Modules. But in C++ Programs are divided into Functions and Classes.
- C does not support inheritance but in C++ supports inheritance.
- Exception Handling is not easy in C. it has to performs using other functions. In C++ Exception Handling provides using Try and Catch Block.