Hi,
Also realise that relational statements (Which involve relational operators such as == , != , < , <= , && , || etc)
evaluate to a logical true or false (aka boolean), which the compiler can use to do conditional flow control like
if
, loops,
switch
etc.
There are also unary operators like & | ^ ! which operate on an integral type number, producing a different number which would be assigned to some variable.
All of these can be used to do flow control, as in:
1 2 3 4 5
|
bool Quit = false;
while (!Quit) {
// do something
}
|
Beginners sometimes confuse the difference between a bool type and boolean evaluation of statements.
They are called
bool
because Mr George Bool was apparently the one who first invented this branch of mathematics involving 0 and 1 with AND, OR, NOT XOR etc operations
Hope this helps a bit :+)