-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memset.c
26 lines (22 loc) · 1.16 KB
/
ft_memset.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gpuscedd <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/23 17:36:18 by gpuscedd #+# #+# */
/* Updated: 2024/01/19 19:50:41 by gpuscedd ### ########.fr */
/* */
/* ************************************************************************** */
/* from string.h | fills the first n bytes of the memory area pointed to by s
* whit the constant byte c. */
#include "libft.h"
void *ft_memset(void *s, int c, size_t n)
{
unsigned char *ptr;
ptr = (unsigned char *) s;
while (n-- > 0)
*(ptr++) = (unsigned char) c;
return (s);
}