-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putstr.c
30 lines (27 loc) · 1.1 KB
/
ft_putstr.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ana-lda- <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/08 18:31:39 by anavolkmann #+# #+# */
/* Updated: 2024/06/26 15:30:39 by ana-lda- ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_putstr(char *str)
{
long int i;
int result;
i = 0;
result = 0;
if (!str)
{
result = write(1, "(null)", 6);
return (result);
}
while (str[i])
result += write(1, &str[i++], 1);
return (result);
}