Open In App

Introduction to C++

Last Updated : 20 Sep, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

C++ is a general-purpose programming language that was developed by Bjarne Stroustrup as an enhancement of the C language to add object-oriented paradigm. The main features C++ programming language are as follows:

  • Simple: It is a simple language in the sense that programs can be broken down into logical units and parts, and has a rich library support and a variety of datatypes.
  • Machine Independent: C++ code can be run on any machine as long as a suitable compiler is provided.
  • Low-level Access: C++ provides low-level access to system resources, which makes it a suitable choice for system programming and writing efficient code.
  • Fast Execution Speed: C++ is one of the fastest high-level languages. There is no additional processing overhead in C++, it is blazing fast.
  • Object-Oriented: One of the strongest points of the language which sets it apart from C. Object-Oriented support helps C++ to make maintainable and extensible programs. i.e. large-scale applications can be built.
main_features_of_c_language

First C++ Program

The below C++ code shows the basic structure of a program. Learn more about how it works in this article.

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

int main() {
    cout << "Hello, World!";
    return 0;
}

Output
Hello, World!

Structure of the C++ program

The basic structure of a C++ program defines the standard way every program must be written; otherwise, it will cause a compilation error. The structure includes:

prim_s_algorithm_14
  1. Header File: #include <iostream> adds input/output objects (cin, cout, etc.) via the preprocessor. Common headers: fstream (files), string (strings), vector (STL), bits/stdc++.h (all-in-one).
  2. Namespace Declaration: using namespace std; allows direct use of standard names like "cout" without std::
  3. Main Function: int main() is the program’s entry point; execution starts here and returns an integer with 0 return mean successful execution.
  4. Comments: // for single line, /*....*/ for multi-line are ignored by the compiler and used only for code documentation.
  5. Statement: Contains executable code. Here, cout << "Hello World!", prints the text on the screen using the insertion operator (<<).
  6. Return: The return 0; statement terminates the main() function and indicates that the program executed successfully.

History of C++

C++ is an object-oriented, middle-level programming language developed by Bjarne Stroustrup at Bell Labs in 1979, originally called “C with Classes” and renamed to C++ in 1983. It extended C by adding features like classes, inheritance, and type checking to support object-oriented programming. Over time, it evolved through standards like C++98, C++11, C++17, C++20, and the latest C++23, adding modern features for performance and safety. Today, C++ remains widely used in system software, game engines, competitive programming, and high-performance applications.

cpp-history

C++ vs Other Languages


Introduction to C++
Visit Course explore course icon
Article Tags :

Explore