ft_alnum: initial implementation

This commit is contained in:
Khaïs COLIN 2024-10-14 14:54:43 +02:00
parent e5601d44ab
commit 04a860d2b2
2 changed files with 24 additions and 2 deletions

View file

@ -6,14 +6,15 @@
# By: kcolin <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/10/14 13:43:59 by kcolin #+# #+# #
# Updated: 2024/10/14 14:44:52 by kcolin ### ########.fr #
# Updated: 2024/10/14 14:49:30 by kcolin ### ########.fr #
# #
# **************************************************************************** #
NAME = libft.a
CFLAGS = -Wall -Wextra -Werror -ggdb
SOURCES = ft_isalpha.c \
ft_isdigit.c
ft_isdigit.c \
ft_isalnum.c
OBJECTS = $(SOURCES:.c=.o)
CC = gcc

21
ft_isalnum.c Normal file
View file

@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isalnum.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/14 14:49:45 by kcolin #+# #+# */
/* Updated: 2024/10/14 14:52:26 by kcolin ### ########.fr */
/* */
/* ************************************************************************** */
int ft_isalnum(int c)
{
if ((c >= 'A' && c <= 'Z')
|| (c >= 'a' && c <= 'z')
|| (c >= '0' && c <= '9'))
return (1);
else
return (0);
}