Does the C standard explicitly indicate the truth values of
trueandfalseas0and1respectively?
The C standard defines true and false as macros in stdbool.h which expand to 1 and 0 respectively.
C11-§7.18:
The remaining three macros are suitable for use in
#ifpreprocessing directives. They aretruewhich expands to the integer constant
1,falsewhich expands to the integer constant
0[…]
For the operators == and != , standard says
C11-§6.5.9/3:
The
==(equal to) and!=(not equal to) operators are analogous to the relational operators except for their lower precedence.108) Each of the operators yields1if the specified relation is true and0if it is false. The result has typeint. For any pair of operands, exactly one of the relations is true.