wiki/articles/cpp.md
2025-02-11 00:30:08 -03:00

1.2 KiB

C++

C++ was created in 1979 as a "C with Classes" (Simula kind of OOP) by Bjarne Stroustrup. Formally released in 1985, it has grown out of control since then.

A bloated programming language, one of its main features aside from OOP is the STL (standard template library) which implementing basic generic data types, arrays, hash tables, etc. Famous for producing almost unintelligible error messages, due to extensive use of templates, which add generic programming capabilities (but in a crippled and slow way) and also slow down compilation, since C++ still uses C headers, even though C++20 introduced modules, almost no compiler at the time of writing this have implemented them properly (or even at all).

Up to a certain degree, C++ is backwards-compatible with C. A notable difference from standard C is that C++ does not allow implicit casting from void pointers to a typed pointer, requiring an explicit cast instead.

Common file extensions for C++ code are .cpp (C with poop) and .cc (crippled C).

Examples

Hello world

#include <iostream>

int main()
{
    std::cout << "Hello, world!\n";
    return 0;
}

See Also