Difference between C and C++

Last Updated : 22 May, 2026

C and C++ are popular programming languages used for system programming, application development, game development, and embedded systems. C is a procedural programming language, while C++ is an extension of C that supports both procedural and object-oriented programming concepts.

  • C focuses mainly on functions and procedures.
  • C++ supports classes, objects, inheritance, and polymorphism.
  • Both languages are fast, efficient, and widely used in software development.

C language

C is a procedural programming language developed by Dennis Ritchie at Bell Labs in 1972. It is widely used for system programming, operating systems, and embedded systems.

  • Follows a top-down programming approach.
  • Mainly focuses on functions and procedures.
  • Provides low-level memory access using pointers.

Example: Hello World Program

C
#include <stdio.h>

int main() {

    printf("Hello World");

    return 0;
}

Output
Hello World

Explanation: Above program prints "Hello World" on the screen using the printf() function.

C++ language

C++ is an extension of the C programming language developed by Bjarne Stroustrup in 1979. It supports both procedural and object-oriented programming features.

  • Follows both procedural and object-oriented programming paradigms.
  • Supports classes, objects, inheritance, and polymorphism.
  • Provides advanced features like function overloading and exception handling.

Example: Hello World Program

C++
#include <iostream>
using namespace std;

int main() {

    cout << "Hello World";

    return 0;
}

Output
Hello World

Explanation: Above program prints "Hello World" on the screen using the cout object.

C Vs C++

FeatureCC++
Programming TypeProcedural Programming LanguageMulti-paradigm Language (Procedural + OOP)
Development YearDeveloped in 1972Developed in 1979
DeveloperDennis RitchieBjarne Stroustrup
Programming ApproachTop-down approachBottom-up approach
Main FocusFunctions and proceduresObjects and classes
Object-Oriented SupportNot supportedFully supported
Classes and ObjectsNot availableAvailable
InheritanceNot supportedSupported
PolymorphismNot supportedSupported
Function OverloadingNot supportedSupported
Operator OverloadingNot supportedSupported
Exception HandlingNot availableAvailable
Namespace SupportNot availableAvailable
Data SecurityLess secureMore secure due to encapsulation
Input/Output Functionsprintf() and scanf()cout and cin
Memory ManagementUses malloc() and free()Uses new and delete
Standard LibraryC Standard LibraryStandard Template Library (STL)
File Extension.c.cpp
Use CasesOperating systems, embedded systemsApplications, games, GUI software
Comment