-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_isalnum.c
40 lines (35 loc) · 1.42 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
39
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isalnum.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mlaffita <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/10 17:10:38 by mlaffita #+# #+# */
/* Updated: 2025/02/06 17:05:29 by mlaffita ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
// verifie si un caractere est alphanumerique
int ft_isalnum(int c)
{
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
|| (c >= '0' && c <= '9'))
return (1);
return (0);
}
/*
#include <stdio.h>
int main()
{
char test1 = 'a';
char test2 = 'B';
char test3 = '7';
char test4 = ' ';
printf("test 1 %c, : %d\n", test1, ft_isalnum(test1));
printf("test 2 %c, : %d\n", test2, ft_isalnum(test2));
printf("test 3 %c, : %d\n", test3, ft_isalnum(test3));
printf("test 4 %c, : %d\n", test4, ft_isalnum(test4));
return (0);
}
*/