Cryptic C
Andrew Koenig
ark at alice.UucP
Mon Aug 26 01:38:12 AEST 1985
> I have always thought that to be a machine dependancy (the value of true and
> false). Maybe I'm wrong. But, different machines DO have different ideas
> of which is true and false (at the assembler level). And it is simply
> a convention.
You are wrong: the value of true and false in C is defined as part of
the language:
When I write if(exp) foo(); else bar(); foo is called if exp is
nonzero and bar is called if exp is zero.
The result of relational operators, &&, ||, and ! is always 1 or 0
(not some random machine-dependent value or zero).
More information about the Comp.lang.c
mailing list