Standard extensions (logical exclusive or)

Andrew Koenig ark at alice.UUCP
Sat Nov 17 01:58:58 AEST 1984

Jim of HCDE says:

	"... although not all machines have booleans as 1, ..."

>From K&R, page 189:

	The operators < (less than), > (greater than), <=
	(less than or equal to), and >= (greater than or
	equal to) all yield 0 if the specified relation is
	false and 1 if it is true.

>From K&R, pag 190:

	The == (equal to) and the != (not equal to) operators are
	exactly analogous to the relational operators except
	for their lower precedcence.

	The && operator groups left-to-right.  It returns
	1 if both its operands are non-zero, 0 otherwise.
	Unlike &, && guarantees left-to-right evaluation;
	moreover the second operand is not evaluated if
	the first operand is 0.

Page 191 contains a similar statement for ||

More information about the Comp.lang.c mailing list