-
Notifications
You must be signed in to change notification settings - Fork 4
/
ft_strrchr.c
28 lines (25 loc) · 1.06 KB
/
ft_strrchr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ykoh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/03 14:52:22 by ykoh #+# #+# */
/* Updated: 2020/04/10 23:54:15 by ykoh ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strrchr(const char *s, int c)
{
char *save;
save = NULL;
while (1)
{
if (*s == (char)c)
save = (char *)s;
if (*s == '\0')
return (save);
s++;
}
}