C _Bool Keyword
Example
Create two boolean variables and print their values:
_Bool isProgrammingFun = 1;
_Bool isFishTasty = 0;
printf("%d\n", isProgrammingFun);
printf("%d", isFishTasty);
Definition and Usage
The _Bool keyword is a data type that can only store the values 1 (true) and 0 (false). If you store any other number in it, the value becomes 1.
Most programs include the <stdbool.h> header instead. Then you can write bool, true and false, which is easier to read.
Related Pages
Read more about booleans in our C Booleans Tutorial.