tgrekov-libft
HIVE libft Oct 2023
Loading...
Searching...
No Matches
ft_strrchr.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* ft_strrchr.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2023/10/24 16:36:17 by tgrekov #+# #+# */
9/* Updated: 2023/11/09 20:04:56 by tgrekov ### ########.fr */
10/* */
11/* ************************************************************************** */
12
30char *ft_strrchr(const char *s, int c)
31{
32 char *last;
33
34 last = 0;
35 while (*s)
36 {
37 if (*s == (char) c)
38 last = (char *) s;
39 s++;
40 }
41 if (*s == (char) c)
42 last = (char *) s;
43 return (last);
44}
char * ft_strrchr(const char *s, int c)
Finds last occurence of c in string at s.
Definition ft_strrchr.c:30