Boolean types

The bool type is conceptually the simplest type supported by C++.  It can have only two values:

In C++, the bool type is actually represented by a numeric value, 0 for false and 1 for true.  (Although I'm not certain, I believe that any non-zero value is interpreted to be true.)

As a result, it is possible to perform arithmetic operations on variables of type bool (but the resulting code may be very confusing).

The bool type is commonly used in some sort of a test to determine what to do next, such as:

if some test returns true, then
  do this
  do that