skeletton untested project
This commit is contained in:
commit
6fc620e8f4
187 changed files with 6584 additions and 0 deletions
27
libft/ft_memchr.c
Executable file
27
libft/ft_memchr.c
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_memchr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/14 17:19:34 by thrieg #+# #+# */
|
||||
/* Updated: 2025/02/16 19:04:05 by thrieg ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
void *ft_memchr(const void *s, int c, size_t n)
|
||||
{
|
||||
const char *str;
|
||||
|
||||
str = (const char *)s;
|
||||
while (n--)
|
||||
{
|
||||
if (*str == (char)c)
|
||||
return ((void *)str);
|
||||
str++;
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue