2 ms·
> int is still the Boolean type in C, and null pointers and zeros are still > falsy, relational expressions yield 0 or 1 of type int, and #define bool > is just
by __d 3y ago
> int is still the Boolean type in C, and null pointers and zeros are still
> falsy, relational expressions yield 0 or 1 of type int, and #define bool
> is just a sham for anal retentives.
Alternatively, and especially in a library API, using bool is a clear specification of semantics.
An int parameter could have many meanings. An int return value similarly. In both cases, using "bool" makes the usage instantly more clear, without the need for comments, or man pages, or Doxygen, or super_long_parameter_names, or whatever.
I think it's useful.