-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint_str.c
44 lines (39 loc) · 1.24 KB
/
print_str.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
34
35
36
37
38
39
40
41
42
43
44
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print_str.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sde-silv <sde-silv@student.42berlin.de> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/12 17:09:00 by sde-silv #+# #+# */
/* Updated: 2023/07/12 17:09:01 by sde-silv ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
static void ft_putstr_fd(char *s, int fd)
{
int i;
i = 0;
while (s[i] != '\0')
{
write (fd, &s[i], 1);
i++;
}
}
static size_t ft_strlen(const char *s)
{
size_t len;
len = 0;
while (s[len] != '\0')
len++;
return (len);
}
*/
int print_str(char *next)
{
if (!next)
next = "(null)";
ft_putstr_fd(next, 1);
return ((int)ft_strlen(next));
}