/ft_printf

Because ft_putnbr() and ft_putstr() aren’t enough

Primary LanguageC

ft_printf

Because ft_putnbr() and ft_putstr() aren’t enough.

Description

ft_printf is a custom implementation of the standard C library function printf. This project aims to provide a versatile and extensible printf function, allowing you to format and print output in a variety of ways.

Roadmap

The following is a roadmap for implementing the features of ft_printf. Each feature corresponds to a specific format specifier:

Character Feature Status
%c Print a Single Character
%s Print a String
%p Print a Pointer in Hexadecimal
%d Print a Decimal Number
%i Print an Integer in Base 10
%u Print an Unsigned Decimal Number
%x Print a Number in Hexadecimal (Lowercase
%X Print a Number in Hexadecimal (Uppercase
%% Print a Percent Sign

Bonus:

The printf formatting with bonus works as follows:

%[flag][width].[precision][format specifier]

the flag is one of the follows:

Character Descrition Status
- Negative width
0 instead of spaces the padding of width is made of 0
# 0x or 0X for hex and upper case hex respectively
<space> Display a before positive numbers
+ Display a + for positive numbers

✅ width

Width is a number that dictates minimum width to be printed, it should work in every format specifier except % for some reason.

✅ precision

I don't know very well, it looks like it should limit the printing of the string somehow, and i didn't search for other specifiers.