-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memset.c
executable file
·33 lines (29 loc) · 1.09 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ngouy <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/03 11:14:14 by ngouy #+# #+# */
/* Updated: 2015/11/04 16:38:56 by ngouy ### ########.fr */
/* */
/* ************************************************************************** */
/*
** Set n byte to c of the allocated memory
*/
#include "libft.h"
void *ft_memset(void *b, int c, size_t len)
{
char *n;
size_t i;
n = b;
i = 0;
while (i < len)
{
*n = (char)c;
n++;
i++;
}
return (b);
}