-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_bzero.c
40 lines (35 loc) · 1.26 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: anamartinez <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/29 19:07:18 by anamart3 #+# #+# */
/* Updated: 2023/05/08 18:59:33 by anamartinez ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_bzero(void *s, size_t n)
{
unsigned char *str;
size_t i;
str = (unsigned char *) s;
i = 0;
while (i < n)
{
str[i] = '\0';
i++;
}
}
/*#include <strings.h>
int main(void)
{
char str[] = "hola";
char str1[] = "hola";
bzero(str, 1);
printf("Official function: %s\n", str + 2);
ft_bzero(str1, 1);
printf("My function: %s", str1 + 2);
return (0);
}*/