42_libft/ft_strrchr.c

28 lines
1.0 KiB
C
Raw Normal View History

2022-09-27 10:29:23 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/27 08:25:33 by cchauvet #+# #+# */
/* Updated: 2022/09/27 11:29:58 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *strrchr(const char *s, int c)
{
char *ret;
ret = NULL;
while (*s)
{
if (*s == (char) c)
ret = (char *) s;
s++;
}
return (ret);
}