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.
[edit] Macros
Macro name | Expands to |
bool
|
_Bool |
true
|
integer constant 1
|
false
|
integer constant 0
|
__bool_true_false_are_defined
|
integer constant 1
|
[edit] Example
Run this code
Possible output:
0 1 1
[edit] See also
C++ documentation for bool
|