Why #define TRUE (1==1) in a C boolean macro instead of simply as 1?

This approach will use the actual boolean type (and resolve to true and false) if the compiler supports it. (specifically, C++)

However, it would be better to check whether C++ is in use (via the __cplusplus macro) and actually use true and false.

In a C compiler, this is equivalent to 0 and 1.
(note that removing the parentheses will break that due to order of operations)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)