skeletton untested project

This commit is contained in:
thrieg 2025-12-11 06:18:16 +01:00
commit 6fc620e8f4
187 changed files with 6584 additions and 0 deletions

29
libft/ft_strrchr.c Executable file
View file

@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/14 17:05:03 by thrieg #+# #+# */
/* Updated: 2025/02/16 19:05:17 by thrieg ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strrchr(const char *s, int c)
{
char *last_occurence;
if ((char)c == '\0')
return ((char *)(s + ft_strlen(s)));
last_occurence = NULL;
while (*s)
{
if (*s == (char)c)
last_occurence = (char *)s;
s++;
}
return (last_occurence);
}