www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/26/09:24:27

Message-ID: <003c01bdb898$c4d253a0$f14b08c3@arthur>
Reply-To: "Arthur" <arfa AT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>
Subject: Re: Loading a BMP picture???
Date: Sun, 26 Jul 1998 12:40:30 +0100
MIME-Version: 1.0

>Unless I am gravely mistaken, the C standard says that NULL *is* the
>same as 0.  Whenever 0 appears in a pointer context, the null pointer is
>used, even if the null pointer on that architecture is not physically
>zero.  In fact, NULL is defined as `(void *)0', which simply makes sure
>it is always used as a pointer.  `#define NULL 0' is also legal.
>
>Thus, `b == NULL' is equivalent to `!b', which tests to see if `b' is
>nonzero.
>
>This is probably a better topic for comp.lang.c; in fact, read its FAQ.
>It talks about this subject at some length.


You are right. The compiler works out that you're talking about NULL
pointers, so b==NULL can be written as !b.


James Arthur
jaa AT arfa DOT clara DOT net

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019