-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memset.c
34 lines (30 loc) · 1.24 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
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dalves-p <dalves-p@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/05/27 08:57:34 by dalves-p #+# #+# */
/* Updated: 2021/06/29 11:24:13 by dalves-p ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** LIBRARY: <strings.h>
** DESCRIPTION:
** The memset() function fills the first len bytes of the memory area pointed
** to by b with the constant byte c.
** It returns a pointer to the memory area b.
*/
void *ft_memset(void *b, int c, size_t len)
{
size_t i;
i = 0;
while (i < len)
{
((unsigned char *)b)[i] = c;
i++;
}
return (b);
}