first commit of v2 ft_printf

This commit is contained in:
2025-11-17 11:26:34 +01:00
commit 506d90d9c1
49 changed files with 1626 additions and 0 deletions

29
42-libft/ft_strrchr.c Normal file
View File

@@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/05 17:28:39 by dgaillet #+# #+# */
/* Updated: 2025/11/12 13:43:49 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strrchr(const char *s, int c)
{
int i;
i = 0;
while (s[i])
i++;
while (i >= 0)
{
if ((unsigned char) s[i] == (unsigned char) c)
return ((char *) &s[i]);
i--;
}
return (NULL);
}