These examples aim to illustrate different features of the C++ programming language
- hello_world.cpp : Where it all begins!
- tutorial_01_templates_classes_and_references.cpp : Tutorial C++ code showing how to use: structs, classes, templates, operator overloading, const, references, namespaces, std:vector, std::format, different 'for' loop versions, doxygen documentation and the standard input and output.
- tutorial_02_containers_and_algorithms.cpp : Sample code showing how to use enum class, std:function, lambdas, some containers (std::vector, std::unordered_map, std::set) and some algorithms using functors (std::sort, std::find_if),
- tutorial_04_runtime_game_object_models.cpp : This long example showcases 3 gameplay programming paradigms: Monolithic Hierarchy, General Components and Entity Component Systems. It is also a good context to learn about inheritance, dynamic polymorphism, raw pointers and unique pointers.
As the examples are in a single file, you can try them easily with one of the following methods. The recomendation is to try a few options at least to understand the general process more than the specifics of a single compiler approach.
- Online C++ compiler: Copy-paste the source code to an online C++ compiler, such as: https://cpp.sh/ or https://godbolt.org/
- Using the 'Developer Command Prompt for VS 2022' on Windows: building_with_cl.md
- Clang on Windows: building_with_clang.md
- Visual Studio on Windows: [WIP]
- MinGW on Windows: [WIP]
- g++ on Ubuntu: [WIP]
- g++ on WSL with Ubuntu: [WIP]