If you are using C99 then you can use the _Bool
type. No #include
s are necessary. You do need to treat it like an integer, though, where 1
is true
and 0
is false
.
You can then define TRUE
and FALSE
.
_Bool this_is_a_Boolean_var = 1;
//or using it with true and false
#define TRUE 1
#define FALSE 0
_Bool var = TRUE;