C++

C++ is an object-oriented programming language created by Bjarne Stroustrup in 1985 as a variant of the C programming language. It includes features not found in C such as classes, virtual dispatch inside of said classes, standardized memory allocation and deallocation, exception unwinding, and a standard library of generic utilities known as the STL (which provides containers like strings, and the vector type, alongside lots more).

The current standardized C++ version is C++20, which added the "consteval" keyword and the Concepts TS, among lots of other improvements.

Hello World
This program prints out "Hello, world!" to the console.

Fizz Buzz
This is a more complex example: this program prints out "Fizz" for each multiple of 3, "Buzz" for each multiple of 5, and "Fizz Buzz" for each multiple of both. This program demonstrates functions besides, the   statement, the ternary operator , and loops.

It also shows the use of the new strongly typed "enum class" kind of enums and the switch statement.

Virtual Functions
Virtual functions are functions part of a class which can be implemented in another inheriting class, allowing the actual implementation to be located somewhere else or even hidden from code.

The example code here shows how a completely abstract class can be implemented inside of a different translation unit (source file), so that the main program only needs the interface to work.

Interface.h:

Interface.cpp:

main.cpp:

Generic code
C++ supports "templates" which are the front and center way of writing generic code. Alongside this, is now the Concepts TS, allowing us to with ease constrain what types a template can operate on.