First of all, your book is outdated - all recent C++ compilers worth mentioning supports the bool type. You use this data type when you need to declare a variable that only will hold one of two values (true or false), just like you would use int when declaring a variable to hold integers. For example:
int invaders_left = 100;bool planet_destroyed = false;
Boolean values (true and false) can be converted to and from integers. In C++, the value true will be converted to the integer value 1 while the value false will be converted to 0. That's not necessarily so in other languages (like Basic dialects). When converting from integers to boolean values, zero is considered false while everything non-zero is considered true.
If you add two integers together, like a + 10 (assuming a is an integer variable), the result will be an integer value. When you compare two values with each other, like a > 10, the result is a boolean value - the result is the answer to the question "is a greater than 10", which must be either "true" or "false".
Hope that helps.
[edited by - spock on July 12, 2002 3:10:42 PM][edited by - spock on July 12, 2002 3:16:07 PM]