-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strrchr.c
More file actions
27 lines (25 loc) · 1.04 KB
/
ft_strrchr.c
File metadata and controls
27 lines (25 loc) · 1.04 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
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_strrchr.c :+: :+: */
/* +:+ */
/* By: ivork <ivork@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2020/11/08 21:07:41 by ivork #+# #+# */
/* Updated: 2021/10/12 17:47:53 by ivork ######## odam.nl */
/* */
/* ************************************************************************** */
char *ft_strrchr(const char *s, int c)
{
int i;
i = 0;
while (s[i] != '\0')
i++;
while (i >= 0)
{
if (s[i] == c)
return ((char *)&s[i]);
i--;
}
return (0);
}