Custom reimplementation of the standard C printf() function. Provides a drop-in ft_printf() alternative designed for integration into libft and other C projects.
# Clone
git clone https://github.com/cmunoz-g/printf.git
cd printf
# Build static library
makeThis produces libftprintf.a.
Include it in your project:
#include "ft_printf.h"
...
ft_printf("Hello, %s!\\n", "world");Compile with:
gcc main.c -L. -lftprintf -o my_program%cβ character%sβ string%pβ pointer (hexadecimal)%dβ decimal integer%iβ integer (base 10)%uβ unsigned decimal%xβ lowercase hexadecimal%Xβ uppercase hexadecimal%%β literal percent sign
- Variadic functions β uses
va_start,va_arg, andva_endto handle variable argument lists. - Modular design β separate functions for each conversion and formatting rule.