diff options
| author | yctct <yctct@yctct.com> | 2026-02-05 11:56:49 +0100 |
|---|---|---|
| committer | yctct <yctct@yctct.com> | 2026-02-05 11:56:49 +0100 |
| commit | 861a36d86e7587c043131228cf3a08afd7bc43ad (patch) | |
| tree | a931df9f1845250c0e93adeda52f139c2f5ee1b0 /ft_isprint.c | |
Add files, first commit
Diffstat (limited to 'ft_isprint.c')
| -rw-r--r-- | ft_isprint.c | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/ft_isprint.c b/ft_isprint.c new file mode 100644 index 0000000..150d609 --- /dev/null +++ b/ft_isprint.c @@ -0,0 +1,90 @@ +/* +Libft Copyright (C) 2026 yctct + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +#include "libft.h" + +int ft_isprint(int c) +{ + if ((c >= 32) && (c <= 126)) + return (1); + return (0); +} + +/* +int main(void) +{ + printf(" for: NULL (0)\n"); + printf("ft_isprint: %d\n", ft_isprint(0)); + printf(" isprint: %d\n", isprint(0)); + printf("\n"); + printf(" for: unit separator (31)\n"); + printf("ft_isprint: %d\n", ft_isprint(31)); + printf(" isprint: %d\n", isprint(31)); + printf("\n"); + printf(" for: / (47)\n"); + printf("ft_isprint: %d\n", ft_isprint(47)); + printf(" isprint: %d\n", isprint(47)); + printf("\n"); + printf(" for: 0 (48)\n"); + printf("ft_isprint: %d\n", ft_isprint(48)); + printf(" isprint: %d\n", isprint(48)); + printf("\n"); + printf(" for: 9 (57)\n"); + printf("ft_isprint: %d\n", ft_isprint(57)); + printf(" isprint: %d\n", isprint(57)); + printf("\n"); + printf(" for: : (58)\n"); + printf("ft_isprint: %d\n", ft_isprint(58)); + printf(" isprint: %d\n", isprint(58)); + printf("\n"); + printf(" for: @ (64)\n"); + printf("ft_isprint: %d\n", ft_isprint(64)); + printf(" isprint: %d\n", isprint(64)); + printf("\n"); + printf(" for: A (65)\n"); + printf("ft_isprint: %d\n", ft_isprint(65)); + printf(" isprint: %d\n", isprint(65)); + printf("\n"); + printf(" for: Z (90)\n"); + printf("ft_isprint: %d\n", ft_isprint(90)); + printf(" isprint: %d\n", isprint(90)); + printf("\n"); + printf(" for: [ (91)\n"); + printf("ft_isprint: %d\n", ft_isprint(91)); + printf(" isprint: %d\n", isprint(91)); + printf("\n"); + printf(" for: ` (96)\n"); + printf("ft_isprint: %d\n", ft_isprint(96)); + printf(" isprint: %d\n", isprint(96)); + printf("\n"); + printf(" for: a (97)\n"); + printf("ft_isprint: %d\n", ft_isprint(97)); + printf(" isprint: %d\n", isprint(97)); + printf("\n"); + printf(" for: z (122)\n"); + printf("ft_isprint: %d\n", ft_isprint(122)); + printf(" isprint: %d\n", isprint(122)); + printf("\n"); + printf(" for: } (123)\n"); + printf("ft_isprint: %d\n", ft_isprint(123)); + printf(" isprint: %d\n", isprint(123)); + printf("\n"); + printf(" for: DEL (127)\n"); + printf("ft_isprint: %d\n", ft_isprint(127)); + printf(" isprint: %d\n", isprint(127)); +} +*/ |
