UtilLib
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_memset.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: yantoine <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/06 11:33:18 by yantoine #+# #+# */
|
||||
/* Updated: 2023/11/09 14:55:20 by hexplor ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include "libft.h"
|
||||
|
||||
void *ft_memset(void *s, int c, size_t n)
|
||||
{
|
||||
size_t index;
|
||||
|
||||
index = 0;
|
||||
while (index < n)
|
||||
{
|
||||
*(unsigned char *)(s + index) = c;
|
||||
index++;
|
||||
}
|
||||
return (s);
|
||||
}
|
||||
Reference in New Issue
Block a user