Boolean Literals

C The C language does not define any Boolean literals, but instead uses the integer values 0 and 1 to represent boolean values. The value zero represents "false" and all nonzero values represent "true."

C defines "true" and "false" as macros in the header file <stdbool.h>. When these macros are defined, the macro __bool_true_false_are_defined is expanded to the integer constant 1.

C++ There are only two boolean literals: true and false. These literals have type bool and are not lvalues.

Related References

IBM Copyright 2003