Quote Originally Posted by GCDEF View Post
You're right, but stylistically, I'd use a bool. Don't forget to initialize it, and watch the and/or logic there. ...
I nomally don't use a variable in the while condition but use an infinite loop and break the loop when the error condition occurs:

Code:
int main()
{

    while (true)   
    {
         ...
         if (input == 'q')   // break the loop when the user types q for quit.
              break;
    }
    return 0;
}
Though the above seems to be more dangerous it actually is less error-prone cause the break would work immediately while the check on 'end' variable works at begin of next loop cycle.