#include
bool func(void)
{ // Function returns a bool type
return false;
// return NULL; // NULL is converted to Boolean false
}
void main(void)
{
bool val = false; // Boolean variable
int i = 1; // i is neither Boolean-true nor Boolean-false
int g = 3;
int *iptr = 0; // null pointer
float j = 1.01; // j is neither Boolean-true nor Boolean-false
if (i == true)
cout if (i == false)
cout if (g)
cout else
cout
// Test on pointer
if (*iptr == false)
cout if (*iptr == true)
cout
// To test j's truth value, cast it to bool type.
if (bool(j) == true)
cout
// Test Boolean function return value
val = func();
if (val == false)
cout if (val == true)
cout }