ft_printf is a 42 Madrid Common Core project in which you have to recode the libc
library printf
function.
ft_printf is a variadic function that will allow you to format any input and send it through the terminal standard output stdout
. It means that this function must take a dynamic number of variables and get their values.
- Function protoype:
int ft_printf(char const *, ...);
- It's not necessary to implement the original
printf
buffer management. - Your function will be compared to the original
printf
. - To create your library you must use the
ar
command.libtool
is forbidden. - Your
libftprintf.a
file must be created in the root folder of the project.
%c
for characters.%s
for strings.%p
forvoid *
pointers.%d
for base 10 decimal numbers.%i
for base 10 integers numbers.%u
for base 10 unsigned decimal numbers.%x
for base 16 lowercase hexadecimal numbers.%X
for base 16 uppercase hexadecimal numbers.%%
for the % character.
- C compiler:
gcc
,cc
, etc... make
utility.libft
library in the project root folder.
make
: compile project.make clean
: deletes compilation files except the executables.make fclean
: deletes all compilation files.make re
: executesmake fclean
andmake
.
-
Clone the repository:
git clone https://github.com/RaulSoftDev/ft_printf.git
-
Build the project:
make
-
Use the library in your project:
#include "ft_printf/libftprintf.h"
-
Compile your project:
gcc -Wall -Wextra -Werror *.c ft_printf/libftprintf.a