Ft_printf is a cool and efficient implementation of the printf()
function! This library, coded from scratch, it aims to replicate the functionality of the original printf()
found in the libc library.
Ensure you have the following files in your project directory:
Makefile
: To compile the project with various options.include/ft_printf.h
: Header files containing function prototypes and necessary declarations.src/*.c
: Source code files implementing theft_printf()
function and supporting functions.
make
: Compiles the project and creates thelibftprintf.a
library.make help
: Displays a list of available commands.make clean
: Removes object files, keeping only the source code.make fclean
: Cleans the project by removing the compiled library and object files.make re
: Performs a full recompilation by cleaning and then recompiling the project.
The implementation uses the following external functions:
malloc
: Allocates memory dynamically.free
: Frees allocated memory.write
: Writes to a file descriptor.va_start
,va_arg
,va_copy
,va_end
: Functions for handling variable arguments.
The main attraction of this library is the ft_printf()
function, which emulates the behavior of the original printf()
. It supports the following conversions:
%c
: Character%s
: String%p
: Pointer%d
: Decimal%i
: Integer%u
: Unsigned integer%x
: Hexadecimal (lowercase)%X
: Hexadecimal (uppercase)%%
: Percentage sign
In addition to the standard functionality, the library includes the following bonuses:
- Any combination of the following flags:
-
,0
,.
- And all the following flags:
#
,+
,space
,*
- Buffer management from the original
printf()
is deliberately not implemented.
If you have any questions or feedback, don't hesitate to reach out. Happy coding! 🚀