use of if (!cptr) and if (cptr), where cptr is a *

King Su wen-king at cit-vax.Caltech.Edu
Wed Jul 19 13:48:00 AEST 1989


In article <93 at microsoft.UUCP> paulc at microsoft.UUCP (Paul Canniff 2/1011) writes:
<In article <10099 at mpx2.mpx.com> erik at mpx2.mpx.com (Erik Murrey) writes:
>>Would (!sptr) break anywhere?  Should it be discouraged?
<
>It will break if NULL != 0.  This is rare in my experience.  In fact

>This was from a *style* guide?  Yeah I suppose it works, though I am
<too lazy to check if the comma operator has a guaranteed order of
 ^^^^^^^^^^^^^^^^^
>evaluation.  I seldom use it.

Why do you bother to post anyway?  The (!sptr) will never break and the
comma operator do guarantee the order of evaluation.

-- 
/*------------------------------------------------------------------------*\
| Wen-King Su  wen-king at vlsi.caltech.edu  Caltech Corp of Cosmic Engineers |
\*------------------------------------------------------------------------*/



More information about the Comp.lang.c mailing list