Karl Dahlke <[email protected]> writes:
> The lack of an internal bool type is perhaps
> the worst omiission of the original C language.
C99 has one. Quoting from Wikipedia [1]:
Begin quote:
Both C99 and C++ have a {boolean type} bool with constants true and false,
but they behave differently. In C++,
bool is a {built-in type} and a {reserved keyword}.
In C99, a new keyword, _Bool, is introduced as the new boolean type.
In many aspects, it behaves much like an unsigned int,
but conversions from other integer types or pointers always constrained to 0
and 1.
Other than for other unsigned types,
and as one would expect for a boolean type,
such a conversion is 0 if and only if the expression in question evaluates to 0
and it is 1 in all other cases. The header stdbool.h provides macros bool,
true and false that are defined as _Bool, 1 and 0, respectively.
End quote.
[1] https://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B
Yea, and the standards didst proliferate,
sowing great confusion amongst the developers that dwelt upon the earth
in those days.
-- Chris
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev