This project is part of the 42 school C++ curriculum. It focuses on C++ casts and how to convert between types safely.
-
ex00 — Implements a
ScalarConverterthat converts a literal representing achar,int,float, ordoubleinto each of the other types, correctly handling edge cases (overflow,nan,inf, non-displayable characters). -
ex01 — Implements a
Serializerthat converts a pointer to an integer type (uintptr_t) and back, demonstrating pointer-to-integer serialization/deserialization without any loss of data. -
ex02 — Implements a simplified Run-Time Type Identification mechanism with a
Baseclass and derived classesA,B, andC, usingdynamic_castto identify the real type of an object at runtime (both with pointers and references). -
Each exercise has its own Makefile:
-
cd ex00 && make # builds the ex00 executableRepeat inside
ex01andex02as needed. Usemake clean,make fclean, ormake reto clean/rebuild.- Follows the 42 Norm
- Compiles without errors or warnings (
-Wall -Wextra -Werror) - Written in C++98