#include <stdio.h>
int ft_str_is_printable(char *str) {
while (*str) {
if (*str < 32 || *str > 126) {
return 0;
}
str++;
}
return 1;
}
int main() {
char str1[] = "ABC";
char str2[] = "AB\n";
printf("%d\n", ft_str_is_printable(str1));
printf("%d\n", ft_str_is_printable(str2));
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: