-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_ft_bzero.c
44 lines (41 loc) · 1.58 KB
/
test_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
43
44
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* test_ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jliew <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/07/01 21:44:17 by jliew #+# #+# */
/* Updated: 2020/07/09 23:22:05 by jliew ### ########.fr */
/* */
/* ************************************************************************** */
#include "stdio.h"
#include "string.h"
#include "libft.h"
int main(int argc, char **argv)
{
if (argc == 1)
{
printf("-------------------------------------------\n");
printf(" void ft_bzero(void *dst, unsigned long n)\n");
printf("-------------------------------------------\n");
printf("usage [manual]:\n1. a <int n>\n");
return (42);
}
char dst1[100];
char dst2[100];
unsigned int n = atoi(argv[1]);
memset(dst1, 1, sizeof(dst1));
memset(dst2, 1, sizeof(dst2));
argc = 0;
bzero(dst1, n);
printf("st: ");
for (int i = 0; i < 100; i++)
printf("%i", dst1[i]);
printf("\n");
ft_bzero(dst2, n);
printf("ft: ");
for (int i = 0; i < 100; i++)
printf("%i", dst2[i]);
printf("\n");
}