From a53f74af41584590d20a135d2d07c5e17afb8364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Mon, 29 Sep 2025 20:02:40 +0200 Subject: [PATCH] feat: add ft_isprint function --- ft_isprint.c | 6 ++++++ libft.h | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ft_isprint.c diff --git a/ft_isprint.c b/ft_isprint.c new file mode 100644 index 0000000..963d57c --- /dev/null +++ b/ft_isprint.c @@ -0,0 +1,6 @@ +#include "libft.h" + +int ft_isprint(int c) +{ + return ((32 <= c && c <= 126)); +} diff --git a/libft.h b/libft.h index 07841ce..f639c76 100644 --- a/libft.h +++ b/libft.h @@ -2,7 +2,7 @@ #define LIBFT_A /* - The isalpha() function tests for + The ft_isalpha() function tests for any character for which isupper(3) or islower(3) is true. */ @@ -32,4 +32,11 @@ int ft_isalnum(int c); */ int ft_isascii(int c); +/* + The ft_isprint() function tests for + any printing character, including + space (‘ ’). +*/ +int ft_isprint(int c); + #endif \ No newline at end of file