Bjarne Stroustrup began the project in 1979 at Bell Labs as “C with Classes,” adding object-oriented features to C; it was renamed C++ in 1983. Rather than replacing C, C++ built directly on top of it — remaining substantially (though not perfectly) source-compatible — while adding classes, templates, exceptions, and, especially since the major C++11 revision, a large set of modern language and library features. C++'s defining philosophy is “zero-overhead abstraction”: a well-written high-level C++ abstraction should compile down to code no slower than the equivalent hand-written low-level code, letting programmers write expressive code without sacrificing C-level performance.
Hello, World — with C++'s own I/O
Unlike C's printf, cout is type-safe at compile time — the compiler chooses the correct overload of operator<< based on the argument's actual type, catching a type mismatch that printf's format-string approach cannot.
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}Multi-paradigm by design
C++ deliberately supports procedural code (like C), object-oriented code (classes, inheritance, polymorphism), generic programming (templates), and increasingly functional-style code (lambdas, ranges) — a program can freely mix these styles rather than being forced into just one, which is both a major strength and a common source of complexity in large C++ codebases.
Still evolving after nearly 50 years
C++11 (2011) was a genuinely transformative release — auto, range-based for loops, lambdas, smart pointers, and move semantics collectively changed how idiomatic C++ is written more than any single release before or since. C++23 is the current fully-published, widely-implemented standard; C++26 technically completed its standardization work in March 2026 and is heading toward formal publication, bringing major new features including compile-time reflection and a "Hardened" standard library mode with automatic bounds checking on containers — addressing memory-safety criticism that has become an increasingly prominent conversation around C++ in recent years.