Difference Between C and C++ language


Difference between C and C++ language:

 C and C++ language have a similar syntax. Code structure of both the language are same.basic  memory model of both is very close to the hardware.

C  program:

  • C is a procedural programming language and does not support classes and objects. It was developed by dennis Ritchie between the year 1969 and 1973 at AT&T bell labs. C does not support polymorphism encapsulation, and inheritance which means that c does not support object oriented program. The subset of c++. It contains 32 keywords. In c programming language data and function are separated because of procedural  programming language.
  • C does not supported information hiding. It is a built in data types in supported in c. c is a function driven language . overloading of function and operator are not support in c. the name space features are not present in c. header file used by c is stdio.h.
  • Reference variables are not supported by c. virtual and friend functions are not supported by c and it is also does not support the inheritance . c does not focus on data it focus on method or process. Direct support for exception handling is not supported by  scanf() and print() functions are used for input and output in c. c structures don’t have access modifiers.

Difference Between C and C++ language


  • C++ is a objected oriented programming and it is support object and classes. It was developed by bjarne stroustrup in 1979. It support polymorphism encapsulation and inheritance because it is an object oriented programming language. C++ is a superset of c. it contains 63 keywords. It is known as hybrid language because c++ supports both procedural and object oriented programming paradigms.
  • The data and function are encapsulated together in form of an object in c++. Data is hidden by the encapsulation to ensure that data structures and operators are used as intended. Built in & user definied data types is supported in c++. C++ is an object driven language because it is an object oriented programming. Function and operator overloading is supported by c++.
  • C ++ is an object driven language. In c++ functions can be used inside a structure in c++. Name space is used by c++ which avoid name collisions. The header file used by c++ is iostream.h. it supports reference variables in c++. Virtual and friend functions are supported by c++. It supports inheritance . c++ is focusing on data instead of method or procedure. Exception handling is supported by c++. Cin and count are used for input and output in c++.  C++ structures have access modifiers.

Difference Between C and C++ language