init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strrchr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rzy <ry@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/08/23 23:16:26 by rzy #+# #+# */
|
||||
/* Updated: 2026/08/23 23:17:56 by rzy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_strrchr(const char *s, int c)
|
||||
{
|
||||
int i;
|
||||
char *occ;
|
||||
|
||||
i = 0;
|
||||
occ = NULL;
|
||||
while (s[i])
|
||||
{
|
||||
if (s[i] == (char)c)
|
||||
occ = (char *)&s[i];
|
||||
++i;
|
||||
}
|
||||
if (s[i] == (char)c)
|
||||
occ = (char *)&s[i];
|
||||
return (occ);
|
||||
}
|
||||
Reference in New Issue
Block a user