Article View: comp.lang.c.moderated
Article #2472Re: references wanted
From: Niall Smart
Date: Wed, 03 Apr 1996 13:05
Date: Wed, 03 Apr 1996 13:05
22 lines
1325 bytes
1325 bytes
ANH@KUHUB.CC.UKANS.EDU wrote: > > :>But here is one simple rule, always use (Type*)0 and not null for null > > :>pointer check. Show my a thousand standards that say I don't need > > :>to do that, I would still use the construct. > > : > > :I'll byte, what exactly does (Type*)0 do that NULL doesn't do and why will > > :it always work whereas NULL may or may not? > > [snip] > Actually, (TYPE*)0 >has been recommended to me by several professors of mine who worked as >software engineer as places such as Bell Labs. I think the reason for this is because (void *) NULL is the correct way to terminate a null terminated variable argument list, just using NULL will not work on some compilers. (So I've heard anyway, I have never used one of these compilers) Niall
Technical Details
Message-ID:
<4jtt35$3f9@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4i6fn8$p0g@solutions.solon.com> <4i97jv$8hn@solutions.solon.com> <4ietaq$b0n@solutions.solon.com> <4imak1$e0j@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: nsmart@indigo.ie (Niall Smart) Newsgroups: comp.lang.c.moderated Subject: Re: references wanted Date: 3 Apr 1996 07:05:41 -0600 Organization: None Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4jtt35$3f9@solutions.solon.com> References: <4i6fn8$p0g@solutions.solon.com> <4i97jv$8hn@solutions.solon.com> <4ietaq$b0n@solutions.solon.com> <4imak1$e0j@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Newsreader: Forte Free Agent 1.0.82