-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_bzero.c
More file actions
46 lines (40 loc) · 1.37 KB
/
ft_bzero.c
File metadata and controls
46 lines (40 loc) · 1.37 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
43
44
45
46
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: simarcha <simarcha@student.42barcelona. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/09 19:04:14 by simarcha #+# #+# */
/* Updated: 2024/09/30 13:23:36 by simarcha ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_bzero(void *s, size_t n)
{
size_t i;
char *str;
i = 0;
str = (char *)s;
while (i < n)
{
str[i] = 0;
i++;
}
}
/*
#include <stdio.h>
#include <strings.h>
#include <stddef.h>
int main()
{
char str[30] = "ABCD EFGH";
char str1[30] = "ABCD EFGH";
printf("Before bzero => %s",str);
bzero(str, -1);
printf("\nAfter bzero => %s\n",str);
printf("Before Simon's bzero => %s",str1);
ft_bzero(str1, -1);
printf("\nAfter Simon's bzero => %s\n",str1);
return (0);
}*/