-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_isascii.c
35 lines (32 loc) · 1.43 KB
/
ft_isascii.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isascii.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edegraev <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/12 10:04:38 by edegraev #+# #+# */
/* Updated: 2023/11/16 09:16:35 by edegraev ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_isascii(int c)
{
if (c >= 0 && c <= 127)
return (1);
return (0);
}
// #include <stdio.h>
// int main(void)
// {
// printf("%d\n", ft_isascii('a')); // 1
// printf("%d\n", ft_isascii('A')); // 1
// printf("%d\n", ft_isascii('z')); // 1
// printf("%d\n", ft_isascii('Z')); // 1
// printf("%d\n", ft_isascii('1')); // 1
// printf("%d\n", ft_isascii(' ')); // 1
// printf("%d\n", ft_isascii('\n')); // 1
// printf("%d\n", ft_isascii('\0')); // 1
// printf("%d\n", ft_isascii(128)); // 0
// printf("%d\n", ft_isascii(-1)); // 0
// }