-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_bzero.c
42 lines (38 loc) · 1.29 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: mbutt <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/16 11:25:09 by mbutt #+# #+# */
/* Updated: 2019/03/26 12:09:30 by mbutt ### ########.fr */
/* */
/* ************************************************************************** */
/*
** bzero -- write zeroes to a byte string
** The bzero() function writes n zeroed bytes to the string s. If n is zero,
** bzero() does nothing.
** bzero() returns no values.
*/
#include "libft.h"
void ft_bzero(void *s, size_t n)
{
char *string;
size_t num;
string = s;
num = 0;
while (num < n)
{
string[num] = 0;
num++;
}
}
/*
** int main (void)
** {
** char s[] = "Test";
** ft_bzero(s, 0);
** return(0);
** }
*/