CPP Modules
A comprehensive series of C++ projects exploring Object-Oriented Programming concepts, memory allocation, templates, and STL.
2022-01-01

CPP Modules
Nine modules covering C++ from the ground up, all written in C++98. The progression is designed for people coming from C, starting with basic class syntax and working up to templates, STL, and multiple inheritance.
Modules
| Module | Topic |
|---|---|
| 00 | Namespaces, classes, member functions, streams |
| 01 | Memory allocation, references, pointers to members |
| 02 | Operator overloading, Orthodox Canonical Form |
| 03 | Inheritance, diamond problem |
| 04 | Virtual functions, abstract classes, interfaces |
| 05 | Exception handling with custom exception hierarchies |
| 06 | C++ casts: static, dynamic, reinterpret, const |
| 07 | Function and class templates |
| 08 | STL containers, iterators, and algorithms |
Things worth noting
The Orthodox Canonical Form comes up early and stays relevant throughout. Every class needs a default constructor, copy constructor, copy assignment operator, and destructor.
Module 02 builds fixed-point arithmetic from scratch using operator overloading, which is a good way to really understand how it works. Module 06 gets into RTTI and when dynamic_cast is actually appropriate vs just being a code smell.
Build
Each exercise has its own Makefile:
cd module_00/ex00
make
./megaphone "hello" "world"SCREENSHOTS // 01 FRAMES
