Skip to content

Commit

Permalink
ft_putnbr base
Browse files Browse the repository at this point in the history
  • Loading branch information
Walid Araissi committed Nov 10, 2022
1 parent 3d454a7 commit 100aa98
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ft_putnbr_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
/* By: waraissi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/09 18:42:39 by waraissi #+# #+# */
/* Updated: 2022/11/10 17:29:22 by waraissi ### ########.fr */
/* Updated: 2022/11/10 18:12:12 by waraissi ### ########.fr */
/* */
/* ************************************************************************** */

#include "ft_printf.h"

void ft_putnbr_base(unsigned long long nbr, int *res)
void ft_putnbr_base(unsigned long long nbr, int *res)
{
char base[] = "0123456789abcdef";

char *base;

base = "0123456789abcdef";
if (nbr < 16)
ft_putchar(base[nbr], res);
ft_putchar(base[nbr], res);
else
{
ft_putnbr_base(nbr / 16, res);
ft_putnbr_base(nbr % 16, res);
}
}
}

0 comments on commit 100aa98

Please sign in to comment.