-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putstr.c
47 lines (41 loc) · 1.29 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ymomen <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/13 16:16:05 by ymomen #+# #+# */
/* Updated: 2023/11/13 23:14:44 by ymomen ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
size_t ft_strlens(char *str)
{
size_t len;
len = 0;
while (str[len])
len++;
return (len);
}
void ft_bzero(void *s, size_t n)
{
size_t count;
char *str;
str = (char *) s;
count = 0;
while (count < n)
{
str[count] = '\0';
count++;
}
}
void ft_putstr(char *str, int *count)
{
if (!str)
{
*count += write(STDUT, "(null)", 6);
return ;
}
*count += write(STDUT, str, ft_strlens(str));
}