github to gitea
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_str_is_printable.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: lfirmin <[email protected]> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/12 21:55:01 by lfirmin #+# #+# */
|
||||
/* Updated: 2024/02/13 00:39:30 by lfirmin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_str_is_printable(char *str)
|
||||
{
|
||||
int c;
|
||||
|
||||
c = 0;
|
||||
while (str[c] != '\0')
|
||||
{
|
||||
if (str[c] < ' ' || str[c] > '~' )
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
c++;
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
/*#include <stdio.h>
|
||||
int main()
|
||||
{
|
||||
char str[] = "HeLlO wOrLd";
|
||||
|
||||
int result = ft_str_is_printable(str);
|
||||
|
||||
if (result)
|
||||
{
|
||||
printf("printable\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("non printable\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}*/
|
||||
Reference in New Issue
Block a user