3 DIFFERENCES BETWEEN C AND C++

Ilteefat Ahmed Khan
3 min readApr 13, 2024

--

  1. DIFFRENCE OF CONCEPTS

->C language supports the concept of functional programming.

In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map values to other values, rather than a sequence of imperative statements which update the running state of the program.

In functional programming, functions are treated as first-class citizens, meaning that they can be bound to names (including local identifiers), passed as arguments, and returned from other functions, just as any other data type can. This allows programs to be written in a declarative and composable style, where small functions are combined in a modular manner.

-> C++ is based on the oops(Object-Oriented Programming) concept.

Object-oriented programming — As the name suggests uses objects in programming. Object-oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism, etc. in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.

There are some basic concepts that act as the building blocks of OOPs i.e.

  1. Class
  2. Objects
  3. Encapsulation
  4. Abstraction
  5. Polymorphism
  6. Inheritance
  7. Dynamic Binding
  8. Message Passing

2. TYPE OF LANGUAGE

-> C is a middle level language.

Medium-level language (MLL) is a type of computer programming language that interacts with the abstraction layer of a computer system. It serves as a bridge between the raw hardware and programming layer of a computer system. MLL is also known as intermediate programming language and pseudo language. C is considered a middle-level language because it binds the gap between a machine-level language and high-level languages

-> C++ is considered as a High level language.

A high-level language (HLL) is a type of programming language designed to simplify computer programming and make it more accessible to humans.

Advertisements
Unlike low-level languages that are closely aligned with a computer’s hardware, high-level languages resemble human languages, both in terms of syntax (the set of rules that defines the combinations of symbols that are considered to be correctly structured programs) and semantics (the meaning of those symbols).

This design approach allows programmers to write codes in a more intuitive way, focusing on solving problems and developing algorithms without getting bogged down by the complexities of the computer’s architecture.

3. DATA AND FUNCTIONS IN BOTH

Data and functions are separated in C because it is a procedural programming language.

Data and functions are encapsulated together in form of an object in C++.

--

--