| C | C++ |
|---|---|
| It is a structural or procedural programming language. | It is an object-oriented programming language. |
| Emphasis is on procedure or steps to solve any problem. | Emphasis is on objects rather than procedure. |
| Functions are the fundamental building blocks. | Objects are the fundamental building blocks. |
| It follows top down approach. | It follows bottom up approach. |
| In C, data is not secured. | In C++, data is secured. |
| It uses scanf () and printf () function for standard input and output. | It uses cin >> and cout << function for standard input and output. |
| Variables must be defined at the beginning in the function. | Variables can be defined anywhere in the function. |
| Memory management operators available in C are malloc, calloc etc. | Better dynamic memory management operators available in C++ are new, delete etc. |
| In C, namespace feature is absent. | In C++, namespace feature is present. |
| C is a middle-level language. | C++ is a high-level language. |
| Programs are divided into modules and functions. | Programs are divided into classes and functions. |
| C program files are saved with .c extension. | C++ program files are saved with .cpp extension. |
| "stdio.h" - header file is used. | "iostream.h" – header file is used. |
| main () should not return a value. | main () should return a value. |
| Features like function overloading and operator overloading are not present. | It supports function overloading and operator overloading. |
| The concept of polymorphism is absent. | The concept of polymorphism is present. |
| The concept of inheritance is absent. | The concept of inheritance is present. |
No comments:
Post a Comment