libft
src
ft_memset.c
Go to the documentation of this file.
1
/* ************************************************************************** */
3
/* */
4
/* ::: :::::::: */
5
/* ft_memset.c :+: :+: :+: */
6
/* +:+ +:+ +:+ */
7
/* By: unite <marvin@42.fr> +#+ +:+ +#+ */
8
/* +#+#+#+#+#+ +#+ */
9
/* Created: 2019/09/05 16:04:34 by unite #+# #+# */
10
/* Updated: 2020/07/16 02:56:06 by unite ### ########.fr */
11
/* */
12
/* ************************************************************************** */
13
14
#include "
libft.h
"
15
20
void
*
ft_memset
(
void
*b,
int
c,
size_t
len)
21
{
22
unsigned
char
*s;
23
unsigned
char
c1;
24
25
s = (
unsigned
char
*)b;
26
c1 = (
unsigned
char)c;
27
while
(len-- > 0)
28
{
29
*s = c1;
30
s++;
31
}
32
return
(b);
33
}
ft_memset
void * ft_memset(void *b, int c, size_t len)
Replicates behaviour of memset from libc.
Definition:
ft_memset.c:20
libft.h
Generated by
1.8.16