previous | start

## Using Boolean Variables

- The bool type can hold exactly two values, denoted false and true.
- Boolean variables are named after George Boole (1815-1864), a pioneer in the study of logic.
- Example:

  >     bool more = true;
  >     while (more)
  >     {
  >        cin >> next;
  >        if (cin.fail())
  >           more = false;
  >        else
  >        {
  >            // process next
  >        }
  >     }

- Don't:

  >     while(more == false) /* don't */

  >     while(more != false) /* don't */

previous | start