-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_bzero.c
31 lines (25 loc) · 1.38 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: amait-ou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/29 14:55:25 by amait-ou #+# #+# */
/* Updated: 2023/01/24 00:06:14 by amait-ou ### ########.fr */
/* */
/* ************************************************************************** */
/*
"ft_bzero" zeroes the given memory according to "n" bytes which is the number
of blocks to be zeroed.
the function takes a void pointer which must be casted to "unsigned
char" since the "ft_bzero" assigns zeroes to the memory byte per byte.
looping over each block of memory and assign it with zero
is a traditional way but using ft_memset which performs the same operation
is more helpful and provide less code.
*/
#include "./superlib.h"
void ft_bzero(void *s, size_t n)
{
ft_memset(s, '\0', n);
}