-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathft_strrchr.c
More file actions
29 lines (26 loc) · 1.08 KB
/
ft_strrchr.c
File metadata and controls
29 lines (26 loc) · 1.08 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: smbaabu <smbaabu@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/21 19:23:14 by smbaabu #+# #+# */
/* Updated: 2019/02/26 00:00:36 by smbaabu ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strrchr(const char *s, int c)
{
char *lst;
lst = NULL;
while (*s)
{
if (*s == (char)c)
lst = (char *)s;
s++;
}
if (*s == (char)c)
return ((char *)s);
return (lst);
}