-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_bzero.c
More file actions
54 lines (49 loc) · 1.9 KB
/
Copy pathft_bzero.c
File metadata and controls
54 lines (49 loc) · 1.9 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
47
48
49
50
51
52
53
54
/* ************************************************************************** */
/* */
/* /#/ |#/|#| */
/* ft_bzero.c /#/ |/ |#| */
/* /#/ /#/ */
/* By: nepcohen <nepcohen@learner.42.tech> /#/ /#/ */
/* /#/____ |#| /| */
/* Created: 2026/05/13 18:49:13 by nepcohen |#######| |#|/#| */
/* Updated: 2026/05/31 00:03:22 by nepcohen |#| NEPH_ */
/* */
/* ************************************************************************** */
//#include "libft" // include define header and external lib declaratio
#include <stddef.h>
/* PROG ===================================================================== */
void ft_bzero(void *s, size_t n)
{
size_t count;
unsigned char *octet;
octet = (unsigned char *)s;
count = 0;
while (count < n)
{
octet[count] = 0;
count++;
}
}
/* MAIN ===================================================================== */
#include <stdio.h>
#include <stdlib.h>
//#include <stddef.h>
void display(char *playS, size_t playN)
{
printf("Chaine :`%s` longueur `%zu`\n", playS, playN);
ft_bzero(playS, playN);
printf("Apres `%s`\n", playS);
}
int main(int argc, char **argv)
{
if (argc != 3)
printf("merci de saisir les deux Arguments");
else
{
display(argv[1], atoi(argv[2]));
}
return (0);
}
/* ========================================================== 42_ =========== */
/* END ===================================================== NEPHCODE ====== */
/* ========================================================================== */