Skip to main content

C++

Pronunciation
SEE-PLUS-PLUS
Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/cpp

In short

C++ is a compiled, statically typed language that extends C with classes and templates while keeping low-level control over memory and performance.

What is C++?

C++ is a general-purpose programming language created by Bjarne Stroustrup at Bell Labs, starting in 1979 as "C with Classes" and renamed C++ in 1983. The name is a programmer's joke: ++ is the C operator that increases a value by one. It is standardized by ISO, with a new version about every three years, such as C++17, C++20, and C++23.

C++ is statically typed and compiles to native machine code. It supports several styles: procedural code like C, object-oriented code with classes and inheritance, and generic code with templates, which generate type-specific versions of functions and classes at compile time. There is no garbage collector; instead, modern C++ relies on RAII (Resource Acquisition Is Initialization), where an object releases its memory or other resources automatically in its destructor when it goes out of scope. Smart pointers such as std::unique_ptr and std::shared_ptr apply this idea to heap memory, so hand-written new and delete are rarely needed.

C++ is common in game engines, web browsers, databases, trading systems, embedded devices, and the performance-critical cores of machine learning libraries. Its guiding principle of "zero-overhead abstractions" means you shouldn't pay a runtime cost for features you don't use. Working in C++ is like having a fully equipped professional workshop: it can build almost anything, but it takes time to learn which tools are safe to use and when.

C++ is no longer just "C with extras." Although it can compile most C code, idiomatic modern C++ looks quite different, using standard containers like std::vector and std::string instead of raw arrays and manual memory management. It is also unrelated to C# beyond the name: C# is a separate language that runs on a managed runtime with a garbage collector.

Key takeaways

  • C++ compiles to native machine code and offers fine-grained control over performance.
  • It supports procedural, object-oriented, and generic programming styles.
  • Memory is managed through scope-based RAII and smart pointers rather than a garbage collector.
  • It is common in game engines, browsers, databases, and other performance-critical software.

Example

Standard containers manage memory for youcpp
#include <iostream>
#include <string>
#include <vector>

int main() {
    // std::vector frees its own memory: no manual delete needed
    std::vector<std::string> names = {"Ada", "Grace", "Alan"};
    names.push_back("Barbara");

    for (const auto& name : names) {
        std::cout << "Hello, " << name << "\n";
    }
    return 0;
}

Readers ask

Is C++ harder to learn than other languages?

C++ is generally considered one of the more complex languages because it is large and gives you direct control over memory. Many learners start with a smaller subset of modern C++, using standard containers and smart pointers, and grow from there.

What is the difference between C++ and C#?

They are separate languages. C++ compiles to native code and manages memory without a garbage collector, while C# runs on the .NET runtime with automatic garbage collection.

What does RAII mean in C++?

RAII (Resource Acquisition Is Initialization) means tying a resource, such as memory, a file, or a lock, to an object's lifetime. The resource is released automatically in the object's destructor when the object goes out of scope.

Often compared

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings