Wikifreedia

C++ - Coding Language

All versions

Overview

C is a cross-platform, high-performance programming language developed as an extension of the C language. It supports both procedural and object-oriented programming paradigms, as well as generic and functional programming styles. C is widely used for system software, game development, embedded systems, high-performance computing, and large-scale applications where performance and control over system resources are critical.

History

Origins: From C to "C with Classes"

C++ was created by Bjarne Stroustrup at Bell Labs in 1979. Stroustrup was working on his PhD thesis and needed a language that combined the efficiency and low-level power of C with high-level abstractions for organizing complex software.

He began developing "C with Classes," which added classes, basic inheritance, default function arguments, and strong type checking to C. The first version was implemented in 1979-1980.

The Name "C++"

The language was renamed to C in 1983. The name is a programmers' joke: in C, the `` operator increments a variable. "C++" thus suggests the language is the next step beyond C. According to Stroustrup, the name was proposed by Rick Mascitti.

First Commercial Release

C was first commercially released in October 1985. The same year, Stroustrup published *The C Programming Language*, the language’s first definitive reference.

Standardization

C was standardized by the International Organization for Standardization (ISO) in 1998 (C98). Major standardized versions include:

Version Year Key Features

C++98

1998

First ISO standard, Standard Template Library (STL)

C++11

2011

Auto keyword, lambda expressions, smart pointers, move semantics

C++14

2014

Generic lambdas, variable templates, binary literals

C++17

2017

Structured bindings, parallel algorithms, filesystem library

C++20

2020

Modules, coroutines, concepts, ranges

C++23

2023

Standard library improvements, std::expected, std::mdspan

Evolution and Influence

C has influenced numerous other languages, including Java, C#, Rust, and D. Major companies including Microsoft, Apple, Google, and Amazon rely heavily on C for performance-critical infrastructure.

What C++ Is About

Philosophy

Unlike Python’s "one obvious way" philosophy, C++ gives programmers extensive choice and control. Stroustrup’s design principles include:

  • Zero-overhead abstractions – High-level features should compile to efficient machine code

  • You don’t pay for what you don’t use – Features you don’t use shouldn’t slow your program

  • Trust the programmer – C++ assumes you know what you’re doing, even if that allows risky operations

  • Multiple paradigms – Use procedural, object-oriented, generic, or functional styles as appropriate

What Makes C++ Different

Manual memory management – C++ gives direct control over memory allocation and deallocation via new and delete, critical for performance-critical applications.

Compiled language – C++ code is compiled directly to machine code, resulting in very fast execution, but longer edit-compile-run cycles.

RAII (Resource Acquisition Is Initialization) – A uniquely C++ idiom where resource management (memory, file handles, locks) is tied to object lifetimes.

Deterministic destruction – Unlike garbage-collected languages, C++ objects are destroyed at predictable times (when they go out of scope).

Pointer arithmetic – Direct memory manipulation inherited from C, allowing fine-grained control but introducing risks.

Header files – C separates declarations (in `.h` or `.hpp` files) from implementations (in `.cpp` files), a feature C20 modules aim to modernize.

Common Use Cases

  • Game development – Most major game engines (Unreal, CryEngine) use C++

  • Operating systems – Parts of Windows, macOS, and Linux kernels

  • Embedded systems – Firmware, medical devices, automotive systems

  • High-frequency trading – Financial systems where microseconds matter

  • Database engines – MySQL, MongoDB, many NoSQL systems

  • Scientific computing – Simulations, modeling, computational physics

  • Web browsers – Chrome, Firefox, Safari rendering engines

  • Compilers and virtual machines – LLVM, Java Virtual Machine (JVM) implementations

Example Snippets

Hello World

#include <iostream>

int main() {
    std::cout << "Hello, C++!" << std::endl;
    return 0;
}

RAII and Smart Pointers

#include <iostream>
#include <memory>
#include <vector>

class Resource {
public:
    Resource() { std::cout << "Resource acquired\n"; }
    ~Resource() { std::cout << "Resource released\n"; }
    void work() { std::cout << "Working...\n"; }
};

int main() {
    // unique_ptr automatically cleans up when out of scope (RAII)
    std::unique_ptr<Resource> ptr = std::make_unique<Resource>();
    ptr->work();

    // Modern C++ container – no manual memory management needed
    std::vector<int> numbers = {1, 2, 3, 4, 5};
    for (int n : numbers) {
        std::cout << n << " ";
    }
    std::cout << std::endl;

    // Resource automatically released when main() exits
    return 0;
}

The C++ Community

C is governed by the ISO C standards committee (formally known as WG21). Major contributors include individuals from industry (Microsoft, Google, Apple, Intel, Bloomberg) and academia.

Key community resources include:

  • ISO C++ website – https://isocpp.org

  • cppreference.com – Community-maintained documentation

  • The C++ Standards Committee – Regular meetings and mailing lists

  • CppCon – Annual conference for the C++ community

  • Meeting C++ – European conference series

Bjarne Stroustrup continues to actively participate in the language’s evolution, though the language is now developed by the full committee rather than any single individual.

Further Resources

License

C is a standardized language, not a specific implementation. Compilers (GCC, Clang, Microsoft Visual C) are open source or commercially licensed under their own terms. The C++ standard itself is copyrighted by ISO and available for purchase, though draft versions are publicly accessible.