Reuse ft_isdigit and ft_strchr from libft

This commit is contained in:
gbaconni
2022-04-29 08:46:53 +02:00
parent 59977253fc
commit 38021fb98f
8 changed files with 114 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isdigit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/11 14:33:30 by gbaconni #+# #+# */
/* Updated: 2021/10/23 16:22:32 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_isdigit(int c)
{
return (c >= '0' && c <= '9');
}

View File

@@ -0,0 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/11 14:34:33 by gbaconni #+# #+# */
/* Updated: 2021/10/23 21:33:09 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
while (*s != (const char)c)
{
if (*s == '\0')
return (NULL);
s++;
}
return ((char *)s);
}