A simple function that converts lowercase to uppercase.
insert======Code:This is what was already given: 1 void Cap(char str[]); 2 int main() { 3 char string[31]; 4 printf("Enter a string of 30 characters or less: "); 5 scanf("%30[^\n]", string); 6 printf("Capitalized: %s\n", Cap(string)); } This is what I wrote: void Cap(char str[]){ int i=0; while (str[i]){ if (str[i]>=97 && str[i]<=122){ str[i]-=32; } else i++; }}
compiler keeps saying 'invalid use of void expression' in line 6.