-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putstring.c
33 lines (30 loc) · 1.1 KB
/
ft_putstring.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstring.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbouderr <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/11 18:26:14 by mbouderr #+# #+# */
/* Updated: 2022/11/11 18:32:27 by mbouderr ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putstring(char *str)
{
int count;
int i;
count = 0;
i = 0;
if (!str)
{
write(1, "(null)", 6);
return (6);
}
while (str[i])
{
count += ft_putchar(str[i]);
i++;
}
return (count);
}