Using true and false in C
Just use 0 or 1 directly in the code.
For C programmers, this is as intuitive as true or false.
I usually do a:
typedef enum {FALSE = 0, TRUE} boolean;
Just include <stdbool.h>
if your system provides it. That defines a number of macros, including bool
, false
, and true
(defined to _Bool
, 0, and 1 respectively). See section 7.16 of C99 for more details.