/ft_printf

This project reproduces a portion of the printf function in C.

Primary LanguageC

FT_PRINTF - @42SP

This project is to recreate the printf function in C.

Nota: 100/100 ✔️

What is the ft_printf?

The ft_printf is a project that aims to recreate the printf function in C. The printf function is a function that is used to print formatted output. The function is declared in the stdio.h header file.

We need to recreate:

  • The following conversions: cspdiuxX%
Examples:
ft_printf("%c", 'a'); -> Print a character
ft_printf("%s", "Hello, World!"); -> Print a string
ft_printf("%p", &variable); -> Print a pointer
ft_printf("%d", 42); -> Print a decimal number
ft_printf("%i", 42); -> Print a integer number
ft_printf("%u", 42); -> Print a unsigned number
ft_printf("%x", 42); -> Print a hexadecimal number in lowercase
ft_printf("%X", 42); -> Print a hexadecimal number in uppercase
ft_printf("%%"); -> Print a percent sign

Output:
a
Hello, World!
0x7ffeeb1b3b08
42
42
42
2a
2A
%