-
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: absalem <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/04 07:57:11 by absalem #+# #+# */
/* Updated: 2023/07/27 12:23:34 by absalem ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memset(void *b, int c, size_t len)
{
int i;
unsigned char *p;
i = 0;
p = (unsigned char *)b;
while (len > 0)
{
p[i] = (unsigned char )c;
i++;
len--;
}
return (b);
}