This is the ft_printf project in 42's curriculum. It replicates the behaviour of the printf function in the C programming language. It handles the following conversions and flags:
- "cspdiuxX%" conversions.
- "0-" flags.
- Width and precision (also with the '*' option).
For more information on this function see the manpage of the C printf function.
Clone this repository and go inside the project folder. Then run:
makeThis will create all the object files and the libftprintf.a static library. This library contains the ft_printf function. To delete all the object files and only keep the libftprintf.a library, run:
make cleanTo use this function, compile and execute this way:
gcc -Wall -Wextra -Werror your_main.c libftprintf.a
./a.outIn which your_main.c should be something like:
#include "src/ft_printf.h"
int main(void)
{
ft_printf("%10.5d\n", 1234567);
return (0);
}The results will be printed on stdout.