Corewar-Final/libft/libft/ft_memset.c
Jeremy FLEURY 748d10f4f3 push
2019-07-17 11:22:24 +02:00

30 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jfleury <jfleury@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/06 15:17:24 by jfleury #+# #+# */
/* Updated: 2018/11/13 18:25:45 by jfleury ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
void *ft_memset(void *s, int c, size_t n)
{
unsigned char *temp;
int i;
i = 0;
temp = (unsigned char*)s;
while (n > 0)
{
temp[i] = c;
i++;
n--;
}
return (s);
}