Home >Backend Development >C++ >What is the difference between C and C++?

What is the difference between C and C++?

王林
王林forward
2023-08-29 23:53:111677browse

What is the difference between C and C++?

C Programming Language

C is a general-purpose, high-level language originally developed by Dennis M. Ritchie at Bell Labs to develop the UNIX operating system. C was first implemented in 1972 on the DEC PDP-11 computer.

In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard.

UNIX operating system, C compiler, and almost all UNIX applications are written in C language. For various reasons, C language has now become a widely used professional language.

  • Easy to learn
  • Structured Language
  • It produces efficient programs
  • It can handle low-level activities
  • Can be compiled on a variety of computer platforms

C Programming Language

C is a statically typed, compiled, general-purpose, case-sensitive, free-form programming language that supports procedural, object-oriented, and generic programming.

C is considered a mid-level language because it combines high-level and low-level language features.

C was developed by Bjarne Stroustrup in Murray Hill, Bell Labs, New Jersey in 1979 as an enhanced version of the C language. It was originally named C with Classes, but was later renamed C in 1983.

C is a superset of C, and almost any legal C program is a legal C program.

Note - A programming language is said to use static typing when type checking is performed at compile time rather than run time.

Object-Oriented Programming

C fully supports object-oriented programming, including the four pillars of object-oriented development -

  • Encapsulation
  • Data hiding
  • inherit
  • Polymorphism

difference

The following are the important differences between C and C.

The Chinese translation of is: The Chinese translation of is:
Sr.No. serial number key C C
1 Developer C was developed by Dennis Richie at AT&T Bell Laboratories from 1969 to 1973. C was developed by Bjarne Stroustrup in 1979.
2 oops C does not support object-oriented concepts such as polymorphism, encapsulation and inheritance. C is an object-oriented programming language that supports object-oriented concepts such as polymorphism, encapsulation, and inheritance.
3SetSET C is a subset of C. C is a superset of C. All code in C can run in C, but the reverse is not necessarily true.
4 Key words C has 32 keywords. C has 52 keywords.
5 Procedural and OOPS C is a procedural programming language. C supports procedural programming and object-oriented programming.
6 Data and Function Data and functions are separated in C. GData and Functions are encapsulated together as objects in C.
7 Information hiding Information hiding is not supported in C. Information hiding is supported through encapsulation in C.
8 Overload Function and operator overloading is not supported in C language. C supports function and operator overloading.
9 Function C is a function-driven language. C is an object-driven language.
10 structure C structure does not support defining functions. C structure supports defining functions.
11 Reference variables Reference variables are not supported in C. C supports reference variables.
12 Virtual and Friend Function Virtual functions and friend functions are not supported in C. C supports virtual functions and friend functions.
13 Exception handling Exception handling is not supported in C language. C supports exception handling.

The above is the detailed content of What is the difference between C and C++?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete