-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_bzero.c
More file actions
38 lines (34 loc) · 1.31 KB
/
ft_bzero.c
File metadata and controls
38 lines (34 loc) · 1.31 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sanmetol <sanmetol@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/08 19:15:23 by sanmetol #+# #+# */
/* Updated: 2023/04/27 17:42:56 by sanmetol ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_bzero(void *s, size_t n)
{
unsigned char *str;
str = s;
while (n--)
*str++ = '\0';
}
/* int main() {
int siu[] = {1, 2, 3, 4, 5};
int bytes = 8;
ft_bzero(siu, bytes);
for (int i = 0; i < sizeof(siu); i++) {
printf("%d ", siu[i]);
}
//////ORIGINAL/////
int siu_o[] = {1, 2, 3, 4, 5};
bzero(siu_o, bytes);
printf("\nORIGINAL\n");
for (int i = 0; i < sizeof(siu); i++) {
printf("%d ", siu_o[i]);
}
} */