Surfi89 / ft_printf

42cursus' ft_printf project. Begin date 06/sep/2021. Finish date 13/sep/2021. About 30h of total work.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ft_print_hex

shawnteh1711 opened this issue · comments

commented

May I know what is the usage of the ft_putchar_fd((num - 10 + 'a'), 1); in the ft_put_hex function?

it is for put the numbers:
10, 11, 12, 13, 14, 15 (from hexadecimal)

to:
a, b, c, d, e, f.

So, for example, it is 10;
10 - 10 = 0,
0 + 'a' = 'a'

commented

Got it. Thank you.

I am so sorry! I did not see your question before.
Thank you gjmacias for your answer.