-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_isascii.c
30 lines (23 loc) · 1.18 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isascii.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: amait-ou <amait-ou@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/29 12:18:49 by amait-ou #+# #+# */
/* Updated: 2023/06/27 18:15:28 by amait-ou ### ########.fr */
/* */
/* ************************************************************************** */
/*
this function checks if the given character is a valid 7-bit.
- 7-bit chars are the characters that have 7 bits in their
binary representation when they got converted from "ASCII" to "binary"
0 -> 0
127 -> 1111111
*/
#include "libft.h"
int ft_isascii(int c)
{
return (c <= 127 && c >= 0);
}