From 030af8d89edef5f397833bc204e9ab253ae95d8d Mon Sep 17 00:00:00 2001 From: Tanguy MAZE Date: Wed, 4 Apr 2018 11:50:38 +0200 Subject: [PATCH] ft_isdigit --- Makefile | 5 +++-- ft_isdigit.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 ft_isdigit.c diff --git a/Makefile b/Makefile index d091a73..c1a6079 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: tmaze +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2018/04/04 10:51:59 by tmaze #+# #+# # -# Updated: 2018/04/04 10:56:20 by tmaze ### ########.fr # +# Updated: 2018/04/04 11:34:29 by tmaze ### ########.fr # # # #******************************************************************************# @@ -16,7 +16,8 @@ CCSTD = -std=c99 NAME = libft.a -SRCS = ft_isalpha.c +SRCS = ft_isalpha.c \ + ft_isdigit.c OBJS = $(SRCS:.c=.o) INCLS = -I. diff --git a/ft_isdigit.c b/ft_isdigit.c new file mode 100644 index 0000000..aa76237 --- /dev/null +++ b/ft_isdigit.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isdigit.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: tmaze +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2018/04/04 11:33:35 by tmaze #+# #+# */ +/* Updated: 2018/04/04 11:34:10 by tmaze ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +int ft_isdigit(int c) +{ + return (c >= '0' && c <= '9'); +}