42_cube3D/libftx/libft/ft_memset.c

29 lines
1.0 KiB
C
Raw Normal View History

2023-04-26 07:02:44 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 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);
}