Why does C use the word _Bool
to define boolean values? Whereas they use the word float
for floats and not _Float
?
Furthermore, wh
_Bool
was not originally in C, but was added in the 1999 C Standard. If it had been called bool
then a large amount of existing code would break because many projects made their own type alias bool
already.
The C89 standard set aside identifiers starting with _
followed by upper-case character as reserved for implementation use. This is why new features added to C always start with such names. _Complex
, _Alignof
and _Static_assert
are other examples.
There is also a header
which aliases bool
to _Bool
and defines true
and false
; this header can be included by new projects or by projects that didn't already define bool
.