ft_str_is_printable.c

This commit is contained in:
Timo Schmidt 2023-03-19 11:16:44 +01:00
parent 221d4c07ea
commit e4e7d76fb6
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_str_is_printable.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/19 11:03:56 by tischmid #+# #+# */
/* Updated: 2023/03/19 11:16:39 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
int ft_str_is_printable(char *str)
{
int i;
i = 0;
while(str[i] >= 32 && str[i] <= 126)
{
++i;
}
return (str[i] == '\0');
}
/* ////
#include <stdio.h>
int main(void)
{
char s[] = "A BCDEF ~~~ ";
printf("%d\n", ft_str_is_printable(s));
return (0);
}
*/ ////