-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_print_str.c
More file actions
40 lines (36 loc) · 1.26 KB
/
ft_print_str.c
File metadata and controls
40 lines (36 loc) · 1.26 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_str.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bhielsch <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/20 10:41:20 by bhielsch #+# #+# */
/* Updated: 2022/10/20 10:41:45 by bhielsch ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_print_str(char *s)
{
int i;
i = 0;
if (s == NULL)
{
write (1, "(null)", 6);
return (6);
}
while (s[i])
{
write (1, &s[i], 1);
i++;
}
return (i);
}
// int main()
// {
// char str[] = "-1241234123";
// int i = ft_print_str(str);
// write (1, "\n", 1);
// printf("Mine :%d\n", i);
// printf("\nOG: %d", printf("%s", str));
// }