The ft_printf project is a 42 School assignment aimed at recreating the functionality of the C standard printf function. It outputs formatted data to the standard output, handling a subset of format specifiers.
The function handles the following conversion specifiers:
- %c — character
- %s — string
- %p — pointer address
- %d — decimal integer
- %i — integer
- %u — unsigned decimal
- %x — lowercase hexadecimal
- %X — uppercase hexadecimal
- %% — literal percent sign
make#include "ft_printf.h"
int main(void)
{
int len = ft_printf("Hello %s!\n", "world");
ft_printf("Printed %d characters.\n", len);
return 0;
}- No use of standard printf or related functions
- Used only allowed libc functions (write, malloc, free)
- Manages memory safely (no leaks or undefined behavior)