if(p)

Art Berggreen ART at ACC.ARPA
Tue Sep 24 04:59:52 AEST 1985



I've been watching the discussion about "if(pointer)" and have not
seen the following observation:

[I'll probably raise flames requarding booleans under C, but please
treat this as an abstract view.]

>From an abstract language viewpoint, an "if" statement conditionally
executes a block of statements based on whether the control statement
evaluates to a condition of *TRUE*.  Pointers by themself do not
have attributes of TRUE vs FALSE.  Thus, "if(pointer)" makes less semantic
sense than "if(pointer == SOME_VALID_POINTER_VALUE)".  What to test against
has been discussed in previous messages.

    				"Art Berggreen"<Art at ACC.ARPA>

Please return any flames to <Pacific_Ocean at Santa_Barbara.California>.

------



More information about the Comp.lang.c mailing list