-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_bzero.c
38 lines (35 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
/* ************************************************************************** */
/* */
/* :::::::: */
/* bzero.c :+: :+: */
/* +:+ */
/* By: ivan-mel <[email protected]> +#+ */
/* +#+ */
/* Created: 2022/10/06 11:46:27 by ivan-mel #+# #+# */
/* Updated: 2022/10/12 13:28:55 by ivan-mel ######## odam.nl */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <string.h>
void ft_bzero(void *s, size_t n)
{
unsigned char *str;
size_t a;
str = (unsigned char *)s;
a = 0;
while (a < n)
{
str[a] = 0;
a++;
}
}
/*
int main(void)
{
char str [] = "Hello";
size_t len = 3;
ft_bzero(str, len);
printf("\n");
printf("%s", bzero(str, len));
return (0);
}*/