1. C language :
C was developed by Dennis Ritchie between the year 1969 and 1973 at AT&T Bell Labs to write Operating System. It is a procedural programming language and does not support classes and objects.
2. C++ language :
C++ was developed by Bjarne Stroustrup in 1979. It has imperative, object-oriented and generic programming features. C++ runs on lots of platform like Windows, Linux, Unix, Mac etc.
Difference between C and C++ :
The main difference between both these languages is C is a procedural programming language and does not support classes and objects, while C++ is a combination of both procedural and object-oriented programming languages.
S.No. | C langaueg | C++ Langaue |
---|---|---|
1. | C was developed by Dennis Ritchie between the year 1969 and 1973 at AT&T Bell Labs. | C++ was developed by Bjarne Stroustrup in 1979. |
2. | C is a subset of C++. | C++ is a superset of C. |
3. | C supports procedural programming. | C++ is known as hybrid language because C++ supports both procedural and object oriented programming paradigms. |
4. | C does not support object oriented programmingC means does not support polymorphism, encapsulation, and inheritance. | C++ is an object oriented programming language so it supports polymorphism, encapsulation, and inheritance. |
5. | C contains 32 keywords. | C++ contains 52 keywords. |
6. | C does not support information hiding. | C++ supports information hiding becasue of encapsulation. |
7. | C does not support inheritance. | C++ supports inheritance. |
8. | Direct support for exception handling is not supported by C. | Exception handling is supported by C++. |
9. | C can have multiple declaration of global variables. | C++ does not allow multiple declaration of global variables. |
10. | C focuses on method or process isntead of data | C++ focuses on data instead of method or procedure. |
11. | Header file used by C is stdio.h. | Header file used by C++ is iostream.h. |
12. | C is a function-driven language. | C++ is an object-driven language |
13. | Functions in C are not defined inside structures. | Functions can be used inside a structure in C++. |
14. | Function and operator overloading is not supported in C. | Function and operator overloading is supported by C++. |
15. | Built-in data types is supported in C. | Built-in & user-defined data types is supported in C++. |
16. | Reference variables are not supported by C. | Reference variables are supported by C++. |
17. | Virtual and friend functions are not supported by C. | Virtual and friend functions are supported by C++. |
18. | C provides malloc() and calloc() functions for dynamic memory allocation, and free() for memory de-allocation. | C++ provides new operator for memory allocation and delete operator for memory de-allocation. |
19. | scanf() and printf() functions are used for input/output in C. | cin and cout are used for input/output in C++. |
20. | Since it is a procedural programming language so data and functions are separated in C. | Data and functions are encapsulated together in form of an object in C++. |
21. | C supports only Pointers. | C++ supports reference variables. |
22. | Polymorphism is not possible in C | C++ provides support for exception handling. Exceptions are used for “hard” errors that make the code incorrect. |
23. | C language offers GTK tool for GUI programming. | C++ supports Qt tools for GUIprogramming. |
24. | C is not compatible with another language. | C++ is compatible with the other generic programming languages. |
25. | C does not allow inline function. | C++ supports inline function. |
26. | The file extension of a C program is .c | The file extension of a c+ + program language is .cpp |
27. | C language follows Top Down programming approach. | C++ follow bottom-up programming approach.. |
28 | In C programming language, a big program code is divided into small pieces which is called functions. | In C++ programming language, a big program code is divided into Objects and Classes. |
29. | C focuses on the steps or procedures that are followed to solve a problem. | C++ emphasizes the objects and not the steps or procedures. It has higher abstraction level. |
30. | C is free-format program source code. | C++ is originally developed from the C programming language. |
31. | C requires all the variables to be defined at the starting of the scope. | C++ allows the declaration of variable anywhere in the scope, i.e., time of its first use. |
32. | In C, we can call main() function through other functions. | In C++, we can not call main() function through other functions. |
Please write comments if you find anything incorrect. A gentle request to share this topic on your social media profile.