Recoded Printf function from Libc. And learn about variadic functions.
This project has two parts organized in two level of difficulty: the mandatory and the bonus part. Mandatory only manages character, string, pointer, decimal, interger, unsigned decimal, hexadecimal and % sign. Bonus part requires to manage -0.# + flags. ft_printf project aims on learning the logic of having an unspecified number of arguments or variadic functions.
- The project must compile with a Makefile without relinking.
- Makefile has to contain at least this rules: $(NAME), all, clean, fclean and re
- The project must compile with -Wall -Wextra -Werror flags.
- After compiling a library named libftprintf.a file has to appear.
> make
> gcc main.c libftprintf.a
> ./a.out
Prototype of the ft_printf function: int ft_printf(const char *, ...);
The Mandatory implements the following conversions:
- %c Prints a single character.
- %s Prints a string (as defined by the common C convention).
- %p The void * pointer argument has to be printed in hexadecimal format.
- %d Prints a decimal (base 10) number.
- %i Prints an integer in base 10.
- %u Prints an unsigned decimal (base 10) number.
- %x Prints a number in hexadecimal (base 16) lowercase format.
- %X Prints a number in hexadecimal (base 16) uppercase format.
- %% Prints a percent sign.
Here are the requirements: • You must use the command ar to create your library. Using the libtool command is forbidden. • Your libftprintf.a has to be created at the root of your repository