mirror of
https://github.com/guezoloic/libft.git
synced 2026-01-25 03:34:16 +00:00
feat: add ft_memset function
This commit is contained in:
16
ft_memset.c
Normal file
16
ft_memset.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "libft.h"
|
||||
|
||||
void *ft_memset(void *b, int c, size_t len)
|
||||
{
|
||||
char *tmp;
|
||||
size_t i;
|
||||
|
||||
tmp = (char *)b;
|
||||
i = 0;
|
||||
while (i < len)
|
||||
{
|
||||
tmp[i] = (char)c;
|
||||
i++;
|
||||
}
|
||||
return (b);
|
||||
}
|
||||
Reference in New Issue
Block a user