Boolean type support library
From cppreference.com
The C programming language, as of C99, supports Boolean arithmetic with the built-in type _Bool
(see _Bool). When the header <stdbool.h>
is included, the Boolean type is also accessible as bool
.
Standard logical operators &&, ||, ! can be used with the Boolean type in any combination.
A program may undefine and perhaps then redefine the macros bool
, true
and false
.
Macros
Macro name | Expands to |
bool
|
_Bool |
true
|
integer constant 1
|
false
|
integer constant 0
|
__bool_true_false_are_defined
|
integer constant 1
|
Example
Run this code
Possible output:
0 1 1
See also
C++ documentation for bool
|