-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strrchr.c
30 lines (27 loc) · 1.08 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
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: motoure <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/07 18:34:41 by motoure #+# #+# */
/* Updated: 2020/01/07 18:34:49 by motoure ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
#include "libft.h"
char *ft_strrchr(const char *s, int c)
{
char *tmp;
tmp = 0;
while (*s)
{
if (*s == c)
tmp = (char *)s;
s++;
}
if (*s == c)
tmp = (char *)s;
return (tmp);
}