A custom implementation of the C standard library function printf(),
built from scratch as part of the 42 School curriculum.
ft_printf is a project that replicates the behavior of the standard printf function. It parses a format string and handles variadic arguments to produce formatted output to standard output. The project is built on top of libft, a custom C utility library.
| Specifier | Description |
|---|---|
%c |
Prints a single character |
%s |
Prints a string (prints (null) if NULL) |
%p |
Prints a pointer address in hexadecimal with 0x prefix (prints (nil) if NULL) |
%d |
Prints a signed decimal integer |
%i |
Prints a signed decimal integer |
%u |
Prints an unsigned decimal integer |
%x |
Prints a number in lowercase hexadecimal |
%X |
Prints a number in uppercase hexadecimal |
%% |
Prints a literal % character |
- GCC or CC compiler
- Make
git clone https://github.com/forzen03/ft_printf.git
cd ft_printf
makeInclude the header in your C files and link the library when compiling:
#include "ft_printf.h"cc your_file.c -L. -lftprintf -o your_programmake clean # Remove object files
make fclean # Remove object files and the library
make re # Rebuild everythingnjaradat — @forzen03