Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!deimos.cis.ksu.edu!rutgers!psuvax1!flee From: flee@shire.cs.psu.edu (Felix Lee) Newsgroups: comp.lang.c Subject: Re: calloc (actually NULL =?= 0) Message-ID: Date: 13 Apr 89 13:58:19 GMT References: <22842@shemp.CS.UCLA.EDU> <1428@auspex.auspex.com> <987@atanasoff.cs.iastate.edu> Sender: news@psuvax1.cs.psu.edu Distribution: na Organization: Penn State University Computer Science Lines: 11 In-reply-to: hascall@atanasoff.cs.iastate.edu's message of 12 Apr 89 20:42:39 GMT The answer is that 0 cast to a pointer type yields a null pointer. And a null pointer cast to an integer yields 0. A null pointer is not necessarily a zero bit pattern. Just as 0.0 is not necessarily a zero bit pattern. Actually, I can't see any particular reason for (int)0 to be a zero bit pattern either (unless it's mandated by pANS). Hmm. I have to go rethink using bit operations, so my code ports easily to Gray code and negabinary computers... :-) -- Felix Lee flee@shire.cs.psu.edu *!psuvax1!shire!flee