init
This commit is contained in:
34
Correction/thellego/ex06/ft_str_is_printable.c
Normal file
34
Correction/thellego/ex06/ft_str_is_printable.c
Normal file
@ -0,0 +1,34 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_str_is_printable.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: thellego <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/07/17 12:17:42 by thellego #+# #+# */
|
||||
/* Updated: 2022/07/17 20:32:27 by thellego ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_str_is_printable(char *str)
|
||||
{
|
||||
int counter;
|
||||
|
||||
counter = 0;
|
||||
while (str[counter])
|
||||
{
|
||||
if (32 <= str[counter] && str[counter] <= 126)
|
||||
{
|
||||
counter++;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
/* int main(){
|
||||
char tab1[120] = "QW ERklzxcvbnm,./;'][=-0987654321`~!@#$%^&*()_+}{";
|
||||
ft_str_is_printable(tab1);
|
||||
} */
|
Reference in New Issue
Block a user