-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_bzero.c
46 lines (41 loc) · 1.28 KB
/
ft_bzero.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lfilloux <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/02 14:43:14 by lfilloux #+# #+# */
/* Updated: 2021/11/02 15:02:17 by lfilloux ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_bzero(void *s, size_t n)
{
size_t i;
char *dest;
i = 0;
dest = (char *)s;
while (i < n)
{
dest[i] = '\0';
i ++;
}
}
/*
int main(void)
{
char *s;
char *test;
size_t len;
len = 10;
s = malloc(sizeof(char) * len + 1);
test = malloc(sizeof(char) * len + 1);
ft_bzero(s, len);
bzero(test, len);
printf ("%s || %s\n", s, test);
free (s);
free (test);
return (0);
}
*/