base struct
This commit is contained in:
28
lib/libft/srcs/mem/ft_memset.c
Normal file
28
lib/libft/srcs/mem/ft_memset.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_memset.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: nalebrun <nalebrun@student.s19.be> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/10 13:06:54 by nalebrun #+# #+# */
|
||||
/* Updated: 2024/11/25 16:15:21 by nalebrun ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../../libft.h"
|
||||
|
||||
void *ft_memset(void *b, int c, size_t len)
|
||||
{
|
||||
unsigned char *ptr;
|
||||
size_t i;
|
||||
|
||||
ptr = (unsigned char *)b;
|
||||
i = 0;
|
||||
while (i < len)
|
||||
{
|
||||
ptr[i] = c;
|
||||
i++;
|
||||
}
|
||||
return (b);
|
||||
}
|
||||
Reference in New Issue
Block a user