If you use C89, I would go with the following definitions:
#define true 1
#define false 0
typedef unsigned char bool;
For memory reasons, _Bool
is usually a 1-byte wide type. And in C99 _Bool
is an unsigned type.
I personally don't like the definitions of bool
as an enum as enum are implementation-defined types while the enum constant are always int
.
Now if you want to favor speed over memory, you should consider using a type that matches the word size of your processor.