-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_isalpha.c
50 lines (44 loc) · 1.74 KB
/
ft_isalpha.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isalpha.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sperez-p <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 12:44:07 by sperez-p #+# #+# */
/* Updated: 2021/08/20 12:44:09 by sperez-p ### ########.fr */
/* */
/* ************************************************************************** */
/*
NAME
****
ft_isalpha ---> is an alphabetic character
SYNOPSIS
***********
#include <ctype.h>
int isalpha(int c);
#include "libft.h"
int ft_isalpha(int c);
DESCRIPTION
***********
The function ft_isalpha() mimics the behavior of the isalpha() function from
ctype C library. Both functions check if c is an alphabetic character.
PARAMETERS
**********
c ---> The character to be checked.
RETURN VALUE
************
- Non-zero value if c is a letter.
- Zero value if not.
*/
/*
RETURN A CONDITION
******************
When we return a condition, the computer will check if the condition is true or
false. If it is true it will return 1(boolean true) and if it is false it will
return 0(boolean false).
*/
int ft_isalpha(int c)
{
return ((c >= 65 && c <= 90) || (c >= 97 && c <= 122));
}