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