Early versions of C did not have explicit boolean (true, false) data types. To handle boolean values, C implicitly converts any zero value into the boolean false value and implicitly converts any nonzero value into the boolean true value. This implicit conversion comes in handy very often but must be used with care.
However, when we use #include <stdbool.h>, the official booltypes and true and falsevalues are available to us. We will explore later how we might choose to define our own boolean values with enumerations (Chapters 9, Creating and Using Structures) or with custom types (Chapter 11, Working with Arrays).
There are three boolean operators:
- ||: The binary logical OR operator
- &&: The binary logical AND operator
- !: The unary logical NOT operator
These are logical operators whose results are always boolean true (nonzero) or false (exactly zero...