Ryan500;
Think of it this way:
A boolean variable, or bool for short, is nothing more than a special integer variable that can only hold two values: 1 or 0.
It's not a matter of true or false, there is no testing involved in the assignment. The c++ language uses the keywords true or false, but you do not need to get lost behind the meaning of the words. It could be Up or down, left or right on or off, etc. It doesn't matter. What matters is that the variable either has a value(1) or is empty(0).
That is all, a simple variable that can only hold two values.
In reality you do not even need to use bools. You can achieve the same results using other types of variables, int, floats or whatever:
e.g
Code:
int var = 0;
if (var == 1)
doSomething;
else if (var == 0)
doSomethingElse;
is exactly the same as:
Code:
bool var = false;
if (var == true)
doSomething;
else if (var == false)
doSomethingElse;
or
Code:
string var = "iEatBananas";
if (var == "iEatStrawberries")
doSomething;
else if (var == "iEatBananas")
doSomethingElse;
In all those examples the code below the 'ifs' will only run if 'var' is equal to whatever you are comparing it to., be it:
Code:
if (var == "airplane"); if ( var == 789); or the dreaded if (var == true);
I hope that helps.
I apologize for the blunder and inaccuracy of my oversimplified statements. I was just trying to explain the concepts in a simple, accessible manner.