My Italian is minimal, but the output says that the phrase is to be converted completely to lower case (miniscule as opposed to capitalized).
ele9, your code's formatting is a problem. When we write code, we need to make it as readable as possible, which is why we keep each statement on a separate line and why we indent the code. It is more for your own benefit that you make your code readable, because you are the one who needs to be able to read it. Read this article on Wikipedia, Indent Style
. I recommend the Allman style
Here is how your code looks properly indented in the Allman style:
void toLower(char *s)
for (i=0; i<strlen(s); i++)
if ( (s[i]>='A') && (s[i]<='Z') )
printf("stampa una frase:");
printf ("Frase convertita completamente in caratteri minuscoli: %s\n",s);
I compiled and ran your code. The only warning I got is that the variable, i, is declared in main but not used; that is one example of a non-malignant warning. Here is what I got:
| C:\otros\dcw>gcc -Wall minuscol.c |
minuscol.c: In function `main':
minuscol.c:14: warning: unused variable `i'
stampa una frase:HellO.
Frase convertita completamente in caratteri minuscoli: hello.
In other words, it appears to work and produces the expected output. Is there an input string that it doesn't work for? If so, then please tell us what that input phrase is so we can test it. The only problem I can see is if the input phrase is longer than 19 characters.