-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memset.c
29 lines (26 loc) · 1.08 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
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: moel-asr <moel-asr@student.1337.ma> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/07 08:57:48 by moel-asr #+# #+# */
/* Updated: 2022/10/16 01:54:14 by moel-asr ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memset(void *s, int c, size_t len)
{
size_t i;
unsigned char *x;
i = 0;
x = (unsigned char *)s;
while (len > i)
{
x[i] = (unsigned char)c;
i++;
}
s = x;
return (s);
}