mirror of
https://github.com/guezoloic/libft.git
synced 2026-01-25 06:34:14 +00:00
16 lines
187 B
C
16 lines
187 B
C
#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] == c)
|
|
return ((char *)s + i);
|
|
i--;
|
|
}
|
|
return (NULL);
|
|
}
|