Files
SignalChat/lib/ft_printf/source/ft_put_unsigned_nbr_fd.c
T
HexPloR 60eef6cebe ew
2024-06-23 23:59:58 +02:00

30 lines
1.2 KiB
C
Executable File

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_put_unsigned_nbr_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hexplor <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/02 23:56:02 by hexplor #+# #+# */
/* Updated: 2023/12/26 15:23:28 by hexplor ### ########.fr */
/* */
/* ************************************************************************** */
#include "../header/ft_printf.h"
int pf_put_unsigned_nbr_fd(unsigned int n, int fd)
{
int count;
count = 0;
if (n >= 10)
{
count += pf_put_unsigned_nbr_fd(n / 10, fd);
count += pf_put_unsigned_nbr_fd(n % 10, fd);
}
else
{
count += pf_putchar_fd(n + '0', fd);
}
return (count);
}