I was writing some code, and came across some trouble. I wanted to write a function that checks if a string has any vowels, and tried to do it through a for loop with a switch statement inside. Apparently, it doesn't work and never returns true for some reason.

```
bool scanStr(string userInp) {
    for (int i = 0; i < userInp.size(); i++) {
        switch (userInp[i])
        {
        case 'a':
        case 'A':
        case 'e':
        case 'E':
        case 'i':
        case 'I':
        case 'o':
        case 'O':
        case 'u':
        case 'U':
        case 'y':
        case 'Y':
            return true;
            break;
        default:
            return false;
        }
    }
}

```

I tried just testing if the program was actually iterating through the string, and it was, so I don't understand why in the function, it always returns false?

```
int main() {
    string userInp;
    string pigLatin;

    cout << "Please enter a string to convert to pig Latin: " << endl;
    cin >> userInp;
    cout << endl;

    // tests
    for (int i = 0; i < userInp.size(); i++) { //checking if it actually iterates
        cout << userInp[i];
    }
    cout << endl;

    if (scanStr(userInp))
        cout << "it has a vowel" << endl;
    else
        cout << "no vowel" << endl;

    system("pause");
    return 0;
}

```

At first I thought that it was because the loop kept on continuing even though there was a break statement after the last case, but I'm not entirely sure if that is the reason.

Any ideas?