init
This commit is contained in:
38
C/c02/ex05/ft_str_is_uppercase.c
Normal file
38
C/c02/ex05/ft_str_is_uppercase.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_str_is_uppercase.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/07/18 10:46:58 by cchauvet #+# #+# */
|
||||
/* Updated: 2022/07/19 13:10:32 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_str_is_uppercase(char *str)
|
||||
{
|
||||
while (*str != 0)
|
||||
{
|
||||
if (!('A' <= *str && *str <= 'Z'))
|
||||
return (0);
|
||||
str++;
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
ft_putchar(ft_str_is_uppercase("AAA")+'0');
|
||||
ft_putchar(ft_str_is_uppercase("dfdf5f")+'0');
|
||||
ft_putchar(ft_str_is_uppercase("Z")+48);
|
||||
ft_putchar(ft_str_is_uppercase("FG5DG")+48);
|
||||
ft_putchar(ft_str_is_uppercase("")+48);
|
||||
}
|
||||
*/
|
Reference in New Issue
Block a user