style: reoarginsed the file and fix the makefile
This commit is contained in:
parent
ecd9608320
commit
a5fe7484a1
46 changed files with 140 additions and 49 deletions
29
str/ft_strchr.c
Normal file
29
str/ft_strchr.c
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strchr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/07 16:32:19 by rparodi #+# #+# */
|
||||
/* Updated: 2023/11/09 12:08:01 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_strchr(const char *s, int c)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
i = 0;
|
||||
if (c == 0)
|
||||
return ((char *)s + ft_strlen(s));
|
||||
while (s[i] != '\0')
|
||||
{
|
||||
if (s[i] == (char)c)
|
||||
return ((char *)s + i);
|
||||
i++;
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue