From f0af8e2225d254d21d4dd9b577010aa7d533b1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Sun, 28 Sep 2025 21:27:50 +0200 Subject: [PATCH] feat: add ft_isalpha function --- Makefile | 2 +- ft_isalpha.c | 8 ++++++++ libft.h | 1 + test.c | 4 ---- 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 ft_isalpha.c create mode 100644 libft.h delete mode 100644 test.c diff --git a/Makefile b/Makefile index 0352608..ae6b27f 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ OBJ = $(SRC:.c=.o) CFLAGS = -Wall -Wextra -Werror -pedantic $(LIB): $(OBJ) # <--- OBJ will run $.o: %.c pattern - $(STATIC) $(LIB) $(OBJ) + $(STATIC) $(LIB) $(OBJ) %.o: %.c # <--- compile any .c file into its corresponding .o automatically ${CC} ${CFLAGS} -c $< -o $@ diff --git a/ft_isalpha.c b/ft_isalpha.c new file mode 100644 index 0000000..1d6f940 --- /dev/null +++ b/ft_isalpha.c @@ -0,0 +1,8 @@ +#include "libft.h" + +int ft_isalpha(const char c) +{ + if ((c > 65 && c < 90) || (c > 97 && c < 122)) + return (1); + return (0); +} diff --git a/libft.h b/libft.h new file mode 100644 index 0000000..697b3f3 --- /dev/null +++ b/libft.h @@ -0,0 +1 @@ +int ft_isalpha(const char c); diff --git a/test.c b/test.c deleted file mode 100644 index b91ccf4..0000000 --- a/test.c +++ /dev/null @@ -1,4 +0,0 @@ -void test(void) -{ - return ; -}