ft_printf was one of the first projects to be carried out at 42. The aim is to re-code the printf function in order to understand how it works. In future projects, the use of printf is forbidden, but we can use our own ft_printf function.
At 42 School, almost every project must be written in accordance to the Norm, the school's coding standard. As a result, the implementation of certain parts may appear strange and for sure had room for improvement.
To use this library, import the "include/ft_printf.h" header into your files after compiling the library.
#include "include/ft_printf.h"
To install the project, clone this repository :
$ [email protected]:julienhouyet/42-ft_printf.git
To compile the library, run :
$ make
To re-compile the library :
$ make re
To wipes all object files :
$ make clean
To delete the library and all object files
$ make fclean
✅ ft_printf
int ft_printf( const char *str, ... );
This ft_printf function supports several format specifiers, described below:
-
%c
- Print a single character; -
%s
- Print a string; -
%p
- Print void * pointer argument in hexadecimal format; -
%d
- Print a decimal (base 10) number; -
%i
- Print an integer in base 10; -
%u
- Prints an unsigned decimal (base 10) number; -
%x
- Print a number in hexadecimal (base 16) lowercase format; -
%X
- Print a number in hexadecimal (base 16) uppercase format; -
%%
- Print a percentage sign;