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.
More Related Contents:
- Do you use the TR 24731 ‘safe’ functions? [closed]
- Setting variable to NULL after free
- Opaque C structs: various ways to declare them
- sizeof with a type or variable
- Parenthesis surrounding return values in C
- srand function is returning same values
- Should you always use ‘int’ for numbers in C, even if they are non-negative?
- Should useless type qualifiers on return types be used, for clarity?
- Why do most C developers use define instead of const? [duplicate]
- Why declare a struct that only contains an array in C?
- Triple pointers in C: is it a matter of style?
- Why is it assumed that send may return with less than requested data transmitted on a blocking socket?
- Do you prefer “if (var)” or “if (var != 0)”? [closed]
- Ignoring return values in C
- Why is “typedef struct foo foo;” considered harmful?
- Need for prefixing a function with (void)
- How to sum the digits of a number using Recursion [C]? [closed]
- String manipulation in C (replace & insert characters)
- strdup() – what does it do in C?
- How to find leap year programmatically in C
- Using “\n” in scanf() in C [duplicate]
- C extension:
- Left shifting with a negative shift count
- What does tilde(~) operator do?
- Mis-aligned pointers on x86
- Sizeof arrays and pointers
- Finding the intersecting node from two intersecting linked lists
- How to tell GCC that a pointer argument is always double-word-aligned?
- Difference between dereferencing pointer and accessing array elements
- Why the ASCII value of a digit character is equal to the value plus ‘0’?