-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_bzero.c
42 lines (34 loc) · 1.37 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tauer <tauer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/06 15:29:07 by tauer #+# #+# */
/* Updated: 2023/11/06 15:29:07 by tauer ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_bzero(void *s, size_t n)
{
unsigned char *c;
if (n <= 0)
return ;
c = s;
while (n-- > 0)
*c++ = 0;
}
// int main(void)
// {
// int array [] = {15 , 20, 50, 60 ,42, 42 , 20};
// int size = sizeof(int) * 7;
// for(int size = 0; size < 7; size++)
// printf("%d ", array[size]);
// printf("\n");
// ft_bzero(array, size);
// for(size = 0; size < 7; size++)
// printf("%d ", array[size]);
// printf("\n");
// return (0);
// }