Archived
1
0

wip_parsing

This commit is contained in:
Maelys
2024-09-10 16:27:06 +02:00
commit c671539661
62 changed files with 1863 additions and 0 deletions

31
libft/str/ft_strrchr.c Normal file
View File

@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: madumerg <madumerg@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/30 16:42:24 by madumerg #+# #+# */
/* Updated: 2023/11/03 15:59:52 by madumerg ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strrchr(const char *str, int p)
{
int i;
i = 0;
while (str[i] != '\0')
i++;
while (i > 0)
{
if (str[i] == (unsigned char)p)
return ((char *) &str[i]);
i--;
}
if (str[i] == (unsigned char)p)
return ((char *) &str[i]);
return (0);
}