httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Re: I *don't* want Paul's style guide.
Date Tue, 02 Jul 1996 14:43:32 GMT
Robert S. Thau wrote:
> 
>   As I understand C,
>   char *p;
> 
>    if (!p) ...
> 
>   is equivalent to
> 
>    if (!(int)p) ...
> 
> You understand C incorrectly.  The result of "!p" is defined to be
> precisely the same as the result of "p != 0", if p has pointer or
> integral type,

Actually, it's arithmetic type rather than integral.

> and to be undefined othrewise.  If p has pointer type,
> this is precisely equivalent to a comparison against NULL.  (Yes, I
> looked it up).
> 
> rst

Cheers,

Ben.

-- 
Ben Laurie                  Phone: +44 (181) 994 6435
Freelance Consultant and    Fax:   +44 (181) 994 6472
Technical Director          Email: ben@algroup.co.uk
A.L. Digital Ltd,           URL: http://www.algroup.co.uk
London, England.

Mime
View raw message