Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1.78 KB

File metadata and controls

21 lines (16 loc) · 1.78 KB

Basic single file C++ examples

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.

Building the examples

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.