ft_printf is a custom reimplementation of the standard C printf function.
It formats and prints output to stdout using variadic arguments (va_list), mimicking the core behavior of printf.
- Returns the total number of characters printed.
- If an error occurs, it returns a negative value.
| Specifier | Description |
|---|---|
%c |
Character |
%s |
String (char *) |
%p |
Pointer (hex address) |
%d / %i |
Signed decimal integer |
%u |
Unsigned decimal integer |
%x |
Hexadecimal (lowercase) |
%X |
Hexadecimal (uppercase) |
%% |
Prints a % |
make
make clean
make fclean
make re#include "ft_printf.h"
int main(void)
{
ft_printf("Hello %s (%d)\n", "world", 42);
return (0);
}This project was completed as part of the 42 curriculum.