This project has been created as part of the 42 curriculum by metaskin.
This project re-implements a small, mandatory subset of printf() as a static library
libftprintf.a. The required conversions are:
%c%s%p%d%i%u%x%X%%
Build the library:
makeThis produces libftprintf.a at the repository root.
Clean:
make cleanFull clean:
make fcleanRebuild:
make reft_printf(format, ...)initializes ava_listand calls the parser.- The parser scans the format string left-to-right.
- Normal chars are written immediately with
write(1, ...). - When a
%is found, the next char is treated as a specifier and dispatched.
- Normal chars are written immediately with
- Each conversion handler prints its representation and returns the number of characters written.
man 3 printfman stdarg
No AI was used for solving the core logic of this project. AI tools were used only for reviewing code style and verifying norm compliance.