Im trying to write a function that detects vowels and digits in a string. iterating through the string, im trying to do a one-line if statement to check if a character is a vowel. Code as below...
void checkString(char *str)
{
char myVowels[] = "AEIOUaeiou";
while(*str != '\0')
{
if(isdigit(*str))
printf("Digit here");
if(strchr(myVowels,*str))
printf("vowel here");
str++;
}
}
The digit checking works perfectly. However "(strchr(myVowels,*str))" doesnt work. It says different types for formal and actual parameter 1. Can anyone help me here? Thanks