init
This commit is contained in:
31
Correction/thellego/ex02/ft_str_is_alpha.c
Normal file
31
Correction/thellego/ex02/ft_str_is_alpha.c
Normal file
@ -0,0 +1,31 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_str_is_alpha.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: thellego <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/07/17 09:49:06 by thellego #+# #+# */
|
||||
/* Updated: 2022/07/17 19:21:41 by thellego ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_str_is_alpha(char *str)
|
||||
{
|
||||
int counter;
|
||||
|
||||
counter = 0;
|
||||
while (str[counter])
|
||||
{
|
||||
if ((65 <= str[counter] && str[counter] <= 90)
|
||||
|| (97 <= str[counter] && str[counter] <= 122))
|
||||
{
|
||||
counter++;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
return (1);
|
||||
}
|
Reference in New Issue
Block a user