-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_isalnum.c
38 lines (32 loc) · 1.25 KB
/
ft_isalnum.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isalnum.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mcosta-d <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/16 16:27:07 by mcosta-d #+# #+# */
/* Updated: 2023/04/16 17:24:49 by mcosta-d ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_isalnum(int nb)
{
if (ft_isalpha(nb) == 1)
return (1);
if (ft_isdigit(nb) == 1)
return (1);
return (0);
}
/*
// Testing the function:
#include<stdio.h>
#include<ctype.h>
int main(void)
{
char c = '=';
printf("The result of my function is %d \n", ft_isalnum(c));
printf ("The result of the original function is %d \n", isalnum(c));
return (0);
}
*/