-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_bzero.c
More file actions
56 lines (51 loc) · 1.77 KB
/
Copy pathft_bzero.c
File metadata and controls
56 lines (51 loc) · 1.77 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
55
56
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zakchouc <zakchouc@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/06 18:30:15 by zakchouc #+# #+# */
/* Updated: 2024/12/02 22:41:06 by zakchouc ### ########.fr */
/* */
/* ************************************************************************** */
/**
* @file ft_bzero.c
* @author Ziyad A. Dev (zakchouc@student.42.fr)
* @brief Erases the data in the n bytes of the memory starting at the location
* pointed to by s, by writing zeros to that area
*
* @param s Pointer to the memory to be erased
* @param n Size of the memory space to be erased in bytes
*
* @return None
* @version 0.1
* @date 2023-11-10
*
* @copyright Copyright (c) 2023
*
*/
#include "libft.h"
void ft_bzero(void *s, size_t n)
{
char *s_ptr;
s_ptr = s;
while (n--)
*s_ptr++ = 0;
}
// int main(void)
// {
// char mystr[] = "salam";
//
// printf("mystr : %s\n", mystr);
// ft_bzero(&mystr, 1);
// printf("mystr : %s\n", mystr);
//
// printf("my c : %c\n", mystr[0]);
// printf("my c : %c\n", mystr[1]);
// printf("my c : %c\n", mystr[2]);
// printf("my c : %c\n", mystr[3]);
// printf("my c : %c\n", mystr[4]);
// printf("my c : %c\n", mystr[5]);
// return (0);
// }