I am trying to create a function that accepts a string and converts all lowercase letters to uppercase and everything else into zeros then prints the string. Here is what I have:
void upperAndZeros(char* toUpper) {
char *toReturn[(sizeof(toUpper) / sizeof(*toUpper)) + 1];
int i;
for (i = 0; toUpper[i] != '\0'; i++) {
if (toUpper[i] >= 'a' && toUpper[i] <= 'z') {
toReturn[i] = (char) toupper(toUpper[i]); //this is line 127 in the code
} else {
toReturn[i] = (char) 0;
}
}
toReturn[i] = '\0';
printf("The modified string is '%s'", toReturn);
}
But when I go to compile this I get the following error:
127:25 warning: assignment makes pointer from integer without a cast