undefined variable, do while loop question

.
Last edited on
Declare balance before the loop:
1
2
3
4
5
6
7
int balance;
do
{
    balance = PlayGame(START_BALANCE);
    cout << "You have $" << balance << endl;
    playAgain = PlayAgain();
} while ((balance > 0) && (playAgain == true)); // Two equals signs here 

Topic archived. No new replies allowed.