This project is part of the 42 Prague curriculum.
The goal of ft_printf is to reimplement the standard C printf function.
It is a key project for learning about variadic functions, formatted output, and modular design in C.
- Clone the repository:
git clone git@github.com:ylam21/ft_printf.git ft_printfcd ft_printf- Compile the library:
makeThis will produce the libftprintf.a static library.
- Include the header in your source file:
#include "ft_printf.h"- Compile your program with the library:
gcc -Ift_printf your_program.c -Llibft -lft -o a.out-Ift_printf tells the compiler where to find ft_printf.h
-Llibft tells the linker where to find libftprintf.a
-lft links the library
make β Compile the library
make clean β Remove object files (.o)
make fclean β Remove object files and the compiled library (libft.a)
make re β Recompile everything (equivalent to fclean + make)
A collection of tests is included in the tests/ folder.
Build the tests
make testsThis compiles all test programs into the tests_bin/ directory.
Run all tests
make run_testsEach test binary will execute, printing results to the console.
Clean test binaries
make clean_testsThe project is built on top of your libft library.
Functions follow the 42 norminette coding standard.
ft_printf is often reused in future projects (e.g., cub3d, minishell).