42_libft/ft_memset.c
Camille Chauvet 1d0f0b1901 m
2022-09-27 16:29:23 +02:00

29 lines
1.0 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/27 09:29:51 by cchauvet #+# #+# */
/* Updated: 2022/09/27 09:48:23 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memset(void *s, int c, size_t n)
{
char *tab;
size_t i;
tab = s;
i = 0;
while (i < n)
{
tab[i] = c;
i++;
}
return (s);
}