Next: Integer Variations, Previous: Conversion among Integer Types, Up: Integer Data Types [Contents][Index]
The unsigned integer type bool
holds truth values: its possible
values are 0 and 1. Converting any nonzero value to bool
results in 1. For example:
bool a = 0;
bool b = 1;
bool c = 4; /* Stores the value 1 in c
. */
Unlike int
, bool
is not a keyword. It is defined in
the header file stdbool.h.