From 3b9a1d7dcc5683b962f2bf24795e80e1c449cd1f Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 15 Jul 2019 08:15:37 +0200 Subject: c07 passed, c08 in progress, rush01(+ 6x6 try) --- rush01_6x6_try/ex00/helper.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 rush01_6x6_try/ex00/helper.c (limited to 'rush01_6x6_try/ex00/helper.c') diff --git a/rush01_6x6_try/ex00/helper.c b/rush01_6x6_try/ex00/helper.c new file mode 100644 index 0000000..eb391ea --- /dev/null +++ b/rush01_6x6_try/ex00/helper.c @@ -0,0 +1,46 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* helper.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/07/13 12:52:42 by cacharle #+# #+# */ +/* Updated: 2019/07/14 10:36:19 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include + +void ft_putchar(char c) +{ + write(1, &c, 1); +} + +void ft_putnbr(int nb) +{ + unsigned int p_nb; + + p_nb = nb; + if (nb < 0) + { + write(1, "-", 1); + p_nb = -nb; + } + if (p_nb > 9) + ft_putnbr(p_nb / 10); + ft_putchar(p_nb % 10 + '0'); +} + +int strlen_ignore_space(char *str) +{ + int counter; + + counter = 0; + while (*str) + { + if (*str != ' ') + counter++; + str++; + } +} -- cgit