#include <stdio.h>
#include <unistd.h>
void ft_putstr(char *str)
{
while (*str)
write(1, str++, 1);
}
void ft_ulstr(char str[])
{
int i;
i = 0;
while (str[i])
{
if (str[i] >= 'a' && str[i] <= 'z')
str[i] -= 32;
else if (str[i] >= 'A' && str[i] <= 'Z')
str[i] += 32;
// else
// str[i] == str[i]; pas besoin
i++;
}
//return (str); // Pas besoin de "return (str);" car la fonction est de type void
}
int main(int ac, char **av)
{
if (ac == 2)
{
ft_ulstr(av[1]);
ft_putstr(av[1]);
write (1, "\n", 1);
}
else
{
write (1, "\n", 1);
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: