- re-added ft_putchar/putnbr/putstr without fd
- added const for pointers in these functions
This commit is contained in:
17
srcs/ft_putnbr.c
Normal file
17
srcs/ft_putnbr.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "libft.h"
|
||||
|
||||
void ft_putnbr(int n)
|
||||
{
|
||||
long l;
|
||||
|
||||
l = n;
|
||||
if (l < 0)
|
||||
{
|
||||
ft_putchar('-');
|
||||
l *= -1;
|
||||
}
|
||||
if (l >= 10)
|
||||
ft_putnbr(l / 10);
|
||||
ft_putchar((l % 10) + '0');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user