dwrswr/cpp-module-06-guide
Read it live: https://dwrswr-cpp-module-06-guide.static.hf.space Everything below describes the files in this repository.
CPP Module 06 — casts, explained line by line
A single-page guide to the 42 C++ Module 06 project (static_cast, reinterpret_cast, dynamic_cast), written against the code in code/ rather than against the subject in the abstract. Every file of ex00, ex01 and ex02 is shown in full and annotated line by line; every terminal block is pasted from a real run.
Open index.html.
What is inside
Three interactive panels, all hand-written with no dependencies: a ScalarConverter simulator, a `dynamic_cast` lab, and the checklist. There is an EN / العربية switch and a light/dark theme toggle in the top bar.
Verified, not assumed
- All three exercises compile with
c++ -Wall -Wextra -Werror -std=c++98(g++ 13.3.0) with zero warnings. - Rebuilt with
-fsanitize=address,undefinedand run: no leaks, no undefined behaviour. - The in-page converter was diffed against the compiled
./converton 46 literals and agrees on all 46 — including2147483647→float: 2147483648.0f, the pseudo-literals, and every rejection. - A grep across all fourteen source files for
printf,alloc,free,using namespace,friend,typeinfoandtypeidreturns nothing.
The page cannot drift from the code
index.html is generated. tools/build.py reads the real sources out of the project and injects them into tools/index.src.html, so a code block on the page is the file on disk:
python tools/build.py # rewrites index.html and refreshes code/Translations are keyed by name in assets/ar.js (data-i18n="s3.m14"), not by position, so adding or reordering a paragraph can never shift a translation onto the wrong element.
Layout
index.html the guide (generated)
assets/style.css design system, dark + light
assets/app.js theme, i18n, C++/Make tokeniser, the three widgets
assets/ar.js Arabic dictionary, 319 keys
code/cpp06/ the project itself, ex00 / ex01 / ex02
tools/build.py generator
tools/index.src.html template