42_minitalk/libftx/libft/ft_memset.c

29 lines
1.0 KiB
C
Raw Permalink Normal View History

2023-01-23 07:22:30 -05: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);
}