style: reoarginsed the file and fix the makefile

This commit is contained in:
Raphael 2024-10-31 12:41:17 +01:00
parent ecd9608320
commit a5fe7484a1
46 changed files with 140 additions and 49 deletions

29
memory/ft_memchr.c Normal file
View file

@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:48:30 by rparodi #+# #+# */
/* Updated: 2023/11/07 18:45:57 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memchr(const void *s, int c, size_t n)
{
size_t i;
char *str;
i = 0;
str = (char *)s;
while (i < n)
{
if ((char)c == str[i])
return ((void *)str + i);
i++;
}
return (NULL);
}