It feels to me as though bool is a fundamental data type for computer programming. Storing true or false has obvious practical applications. Yet, some people seem to deprecate bool. It isn't in standard C89. And in any case, bool can be pretty easily simulated like this:
Code:
typedef bool unsigned int;
#define true 1
#define false 0
I'd like to use something like this:
Code:
typedef enum blah { false = 0, true = 1 } bool;
1. Do you consider bool to be a useful and necessary data type?
2. How does one best simulate/replace bool for a system that doesn't support C99/C++?
Richard