28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_memset.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: rzy <ry@student.42angouleme.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/08/23 22:29:57 by rzy #+# #+# */
|
|
/* Updated: 2026/08/23 22:31:46 by rzy ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
#include "libft.h"
|
|
|
|
void *ft_memset(void *s, int c, size_t n)
|
|
{
|
|
unsigned char *ptr;
|
|
size_t i;
|
|
|
|
ptr = (unsigned char *)s;
|
|
i = 0;
|
|
while (i < n)
|
|
{
|
|
ptr[i] = (unsigned char)c;
|
|
++i;
|
|
}
|
|
return (s);
|
|
}
|