creation du main de testing et du test de abs
This commit is contained in:
28
testing/srcs/test_putnbr_fd.c
Normal file
28
testing/srcs/test_putnbr_fd.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_putnbr_fd.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/11/25 13:59:56 by hulamy #+# #+# */
|
||||
/* Updated: 2019/11/25 13:59:57 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
void ft_putnbr_fd(int n, int fd)
|
||||
{
|
||||
long l;
|
||||
|
||||
l = n;
|
||||
if (l < 0)
|
||||
{
|
||||
ft_putchar_fd('-', fd);
|
||||
l *= -1;
|
||||
}
|
||||
if (l >= 10)
|
||||
ft_putnbr_fd(l / 10, fd);
|
||||
ft_putchar_fd((l % 10) + '0', fd);
|
||||
}
|
||||
Reference in New Issue
Block a user