So here is my code: 

```
int k = 1;
string sTemp = "";

do {
    cout << "Enter the ID number for sequence " << k << ": ";
    cin >> sTemp;
    if(!bValid_digit(sTemp))
        cout << "Invalid input. ID number must be 3 digits long.\n\n";
    else if(bIs_taken(sTemp))
        cout << "Invalid input. ID number cannot be the same as a previous member.\n\n";
    else {
        k++;
        ID.push_back(sTemp);
        stored_ID.push_back(sTemp);
    }
}
while(bIs_taken(sTemp) || !bValid_digit(sTemp) || ID.size() != 10);

```

What I'm doing there is getting user input for a 3-digit ID member, for which I have a separate function `bValid_digit()`, which works fine; then I test if the ID number is already taken by using the function `bIs_taken()`, which also works fine; then I test for `ID.size() != 10` in the condition of the do-while loop, because I only want the user to input 10 ID numbers, and therein lies the problem. Why is the loop not exiting when `ID.size()` reaches 10?

I tested the `ID.size()` by `cout`ing the size after each run of the loop and it does indeed reach size 10 after the 10th valid ID input, but the loop still doesn't end. Why?

Edit: `ID` and `stored_ID` are both string vectors somewhere else in the function.