C++

C++ (pronounced "c plus plus") is a computer programming language based on C. It was created for writing computer programs. In the 1990s, C++ became one of the most used programming languages in the world. Like C, C++ uses manual memory management (unlike most mainstream languages, where memory management is automatic), while the syntax usually used for it is similar, but different.

The C++ programming language was developed by Bjarne Stroustrup at Bell Labs in the 1980s, and was originally named "C with classes". The language was planned as an improvement on the C programming language, adding features based on object-oriented programming. Step by step, a lot of advanced features were added to the language, like exception handling, templates, "move semantics" and namespaces (not full module support, while that was added later) and new operator overloading capabilities were added in versions C++11 and C++20.

C++ runs on a most platforms (all mainstream ones), such as Windows and the various versions of UNIX, such as macOS, Linux, and BSD. Introduction to C++ language is a practical approach to describe the concepts of C++ for beginners to advanced software engineers.

C++ is a general-purpose programming language, which means that it can be used to create many kinds of applications.

C++20 is the latest version of the standard, which finally added for example module support in December 2020 (while many languages supported modules a decade, if not two or more, earlier). The major compilers have almost complete support for C++20, while almost all default to the older C++17 standard, so a compiler switch is needed to enable the C++20 support the compilers have.

New C++ standards are on a three-year schedule, so the next one, C++23, is expected in 2023, and some compilers already have some (partial) support for that experimental standard. The many earlier C++ standards have each added stuff to the language, almost never taken stuff out, so mostly keeping compatibility with older standards.

 Example 
The following text is C++ source code, and it will write the words "Hello World!" on the screen when it has been compiled and is executed. This program is typically the first program a programmer would write while learning about programming languages.

// This is a comment. It's for *people* to read, not computers. It's usually used to describe the program.

// Make the I/O standard library available for use in the program.
#include <iostream>

// We are now defining the main function; it is the function run when the program starts.
int main()
{
    // Printing a message to the screen using the standard output stream std::cout.
    std::cout << "Hello World!";
    return 0;
}

This program is similar to the last, except it will add 3 + 2 and print the answer instead of "Hello World!".

#include <iostream>

int main()
{
    // Print a simple calculation.
    std::cout << 3 + 2;
    return 0;
}

This program subtracts, multiplies, divides and then prints the answer on the screen.

#include <iostream>

int main()
{
    // Create and initialize three variables, a, b, and c, to 5, 10, and 20.
    int a = 5;
    int b = 10;
    int c = 20;

    // Print calculations.
    std::cout << a-b-c;
    std::cout << a*b*c;
    std::cout << a/b/c;
    return 0;
}

 Manual memory management 
C++ introduced two keywords new and delete for manual memory management (while also keeping compatibility with the old way C uses), and the constructor and destructor concepts. In modern C++ code, using new and delete (and destructors) is no longer preferred in high-level code, rather containers such as std:vector (which at a low level are implemented with new and delete).

 References 

Category:Multi-paradigm programming languages
Category:Object-oriented programming languages
Category:Cross-platform software
Category:High-level programming languages