From bbd0e4a3a1640072f19cfc7e8d01ced3a855870c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Sun, 28 Sep 2025 21:39:29 +0200 Subject: [PATCH] feat: add ft_isdigit function and header --- ft_isdigit.c | 8 ++++++++ libft.h | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 ft_isdigit.c diff --git a/ft_isdigit.c b/ft_isdigit.c new file mode 100644 index 0000000..e74b707 --- /dev/null +++ b/ft_isdigit.c @@ -0,0 +1,8 @@ +#include "libft.h" + +int ft_isdigit(int c) +{ + if ((c >= '0' && c <= '9')) + return (1); + return (0); +} diff --git a/libft.h b/libft.h index 697b3f3..16f43aa 100644 --- a/libft.h +++ b/libft.h @@ -1 +1,2 @@ -int ft_isalpha(const char c); +int ft_isalpha(const char c); +int ft_isdigit(int c);