@kbw13 a bool is a variable that's either true or false. You can also think of it like a flag (if you have ever heard of that). Basically in this case you can use it to keep track of whether or not you should continue.
In my code I should have included
rather than
You should check out
http://www.cplusplus.com/doc/tutorial/operators/ and scroll down to Relational and equality operators ( ==, !=, >, <, >=, <= ) and Logical operators ( !, &&, || ) these are really important things to know!!!
and also
http://www.cplusplus.com/doc/tutorial/variables/ has a section on bools
also, the
oposite of the example i gave you would be
is the same thing as
1 2
|
while( bAgain != true )
|
is the same thing as
they are the EXACT same thing... it's just that the first one is easier to understand whereas once you understand what's going on the second is easier to read. It is called a bool because it refers to a boolean value, which is like a binary value. In reality,
true
really is the same thing as 1 and
false
is the same thing as 0. You can think of a bool like an int that can only be equal to 1 or 0. I hope that wasn't confusing... did I answer your question?