ft_printf is a custom implementation of the standard C printf function.
The goal of the project is to handle formatted output for different data types while reinforcing core C programming concepts.
After compiling your ft_printf project, you can use it like the standard printf:
#include "ft_printf.h"
int main(void)
{
ft_printf("Hello %s!\n", "world");
ft_printf("Number: %d, Hex: %x\n", 42, 42);
return 0;
}%c– character
%s – string
%d / %i – integer
%u – unsigned integer
%x / %X – hexadecimal
%p – pointer
%% – literal %
ft_printf works by:
- Parsing the format string.
- Identifying format specifiers.
- Using variadic functions to retrieve arguments.
- Converting and printing each argument according to its format.
- Handling variadic functions in C.
- Parsing and interpreting format strings.
- Converting integers to strings and hexadecimal.
- Managing output for multiple data types.
- Strengthening core C programming skills.