-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_bzero.c
43 lines (39 loc) · 1.2 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sde-silv <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/16 15:29:24 by sde-silv #+# #+# */
/* Updated: 2023/06/12 14:47:28 by sde-silv ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
#include <string.h>
*/
void ft_bzero(void *s, size_t n)
{
unsigned char *p;
p = s;
while (n > 0)
{
*p = '\0';
p ++;
n --;
}
}
/*
int main(void)
{
char arr[12] = "Hello World";
char *p;
p = arr + 3;
write (1, arr, 12);
write (1, "\n", 1);
ft_bzero(p, 3);
write (1, arr, 12);
return (0);
}
*/