Definition of boolean type
T. William Wells
bill at twwells.uucp
Tue Feb 14 00:35:54 AEST 1989
In article <2113 at buengc.BU.EDU> bph at buengc.bu.edu (Blair P. Houghton) writes:
: boolfoo = !!expr_returning_funny_bools;
:
: which, according to my KnR, should never ever give any boolfoo other
: than 0 or 1, even if the expr has a dozen different values for true.
It'll work, but try
boolfoo = expr_returning_funny_bools != 0;
It's clearer.
---
Bill
{ uunet!proxftl | novavax } !twwells!bill
More information about the Comp.lang.c
mailing list