-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memset.c
More file actions
32 lines (28 loc) · 1.24 KB
/
ft_memset.c
File metadata and controls
32 lines (28 loc) · 1.24 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jados-sa <jados-sa@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/25 19:17:19 by jados-sa #+# #+# */
/* Updated: 2024/10/29 18:34:49 by jados-sa ### ########.fr */
/* */
/* ************************************************************************** */
/* Fill memory with a constant bytei *
* Fills the first n bytes of the memory area pointed to by s with the *
* constant byte c. */
#include "libft.h"
void *ft_memset(void *dest, int c, size_t n)
{
size_t i;
unsigned char *d;
d = (unsigned char *) dest;
i = 0;
while (i < n)
{
d[i] = (unsigned char) c;
i++;
}
return (d);
}