From e5601d44abe90de178df46fef82f03b0174ebfe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Mon, 14 Oct 2024 14:48:30 +0200 Subject: [PATCH] ft_isdigit: inital implementation --- Makefile | 5 +++-- ft_isdigit.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 ft_isdigit.c diff --git a/Makefile b/Makefile index 35abca3..b5db6fd 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,14 @@ # By: kcolin +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2024/10/14 13:43:59 by kcolin #+# #+# # -# Updated: 2024/10/14 14:40:26 by kcolin ### ########.fr # +# Updated: 2024/10/14 14:44:52 by kcolin ### ########.fr # # # # **************************************************************************** # NAME = libft.a CFLAGS = -Wall -Wextra -Werror -ggdb -SOURCES = ft_isalpha.c +SOURCES = ft_isalpha.c \ + ft_isdigit.c OBJECTS = $(SOURCES:.c=.o) CC = gcc diff --git a/ft_isdigit.c b/ft_isdigit.c new file mode 100644 index 0000000..1169822 --- /dev/null +++ b/ft_isdigit.c @@ -0,0 +1,19 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isdigit.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: kcolin +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/10/14 14:41:12 by kcolin #+# #+# */ +/* Updated: 2024/10/14 14:46:21 by kcolin ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_isdigit(int c) +{ + if (c >= '0' && c <= '9') + return (1); + else + return (0); +}