From 925989f7e7af67d965e2b501a51068acfe449ab0 Mon Sep 17 00:00:00 2001 From: yctct Date: Wed, 28 Jan 2026 12:43:28 +0100 Subject: Add all files, first commit --- ft_putstr.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ft_putstr.c (limited to 'ft_putstr.c') diff --git a/ft_putstr.c b/ft_putstr.c new file mode 100644 index 0000000..19a2c37 --- /dev/null +++ b/ft_putstr.c @@ -0,0 +1,29 @@ + +// we use putchar to count each character + +#include "ft_printf.h" + +int ft_putstr(char *str) +{ + int counter; + const char *snull = "(null)"; + + counter = 0; + if (str == NULL) + { + while (*snull) + { + counter += ft_putchar(*snull); + snull++; + } + } + else + { + while (*str) + { + counter += ft_putchar(*str); + str++; + } + } + return (counter); +} -- cgit v1.2.3