I tried your statment for the base case:
I receive two errors while compiling!
if (phrase == "")
c:\Documents and Settings\...\T3Q24_Vowels.cpp(29): error C2040: '==' : 'int' differs in levels of indirection from 'const char '
c:\Documents and Settings\...\T3Q24_Vowels.cpp(29): error C2446: '==' : no conversion from 'const char *' to 'int'
so, I reverted back to the phrase.empty() becasue it not only doesn't have vowels it doesn't have anything. phrase.empty() works as a base case, but the rest doesn't.
However I changed the string to a pass by reference and changed the OR list of vowel checks to case statement and I now get just one vowel no matter what the string contains. I also changed the return to use the phrase.substr() to knock off the first character in the string, or that was my intent.
the new code is:
I appreciate the help and am trying all the suggestions.
int vowels(const string& phrase)
case 'a': case 'A':
case 'e': case 'E':
case 'i': case 'I':
case 'o': case 'O':
case 'u': case 'U':
return vowels(phrase) + vowels(phrase.substr(1, phrase.size()));