-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_bzero.c
More file actions
42 lines (37 loc) · 1.3 KB
/
ft_bzero.c
File metadata and controls
42 lines (37 loc) · 1.3 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dhuss <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/11 10:56:20 by dhuss #+# #+# */
/* Updated: 2024/03/13 10:57:00 by dhuss ### ########.fr */
/* */
/* ************************************************************************** */
/* #include <stdio.h>
#include <string.h> */
#include "libft.h"
void ft_bzero(void *s, size_t n)
{
unsigned char *ptr;
size_t i;
i = 0;
ptr = (unsigned char *)s;
while (i < n)
{
ptr[i] = '\0';
i++;
}
}
/* int main(void)
{
char b[] = "PlsBZero";
size_t n;
n = 20;
printf("Before Ft and Original: %s\n", b);
ft_bzero(b, n);
printf("After Ft: %s\n", b);
printf("After Original: %s\n", bzero(b, n));
return (0);
} */