29 lines
1.2 KiB
Markdown
29 lines
1.2 KiB
Markdown
# C++
|
|
C++ was created in 1979 as a "C with Classes" ([Simula](simula.md) 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](oop.md) 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
|
|
```cpp
|
|
#include <iostream>
|
|
|
|
int main()
|
|
{
|
|
std::cout << "Hello, world!\n";
|
|
return 0;
|
|
}
|
|
```
|
|
|
|
## See Also
|
|
- [C](c.md)
|
|
- [Bloat](bloat.md)
|