init
This commit is contained in:
24
libftx/libft/ft_strrchr.c
Normal file
24
libftx/libft/ft_strrchr.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strrchr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/09/27 08:25:33 by cchauvet #+# #+# */
|
||||
/* Updated: 2022/10/05 20:50:49 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_strrchr(const char *s, int c)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
i = ft_strlen(s) + 1;
|
||||
while (i-- > 0)
|
||||
if (s[i] == (char) c)
|
||||
return ((char *) s + i);
|
||||
return (NULL);
|
||||
}
|
||||
Reference in New Issue
Block a user