Path: utzoo!attcan!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: the nil pointer is not zero Message-ID: <525@taumet.com> Date: 19 Nov 90 16:33:52 GMT References: <27636@mimsy.umd.edu> <164@nazgul.UUCP> <14516@smoke.brl.mil> <1990Nov18.024151.19321@ux1.cso.uiuc.edu> Organization: Taumetric Corporation, San Diego Lines: 23 mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes: |The point is that if it were indeed actually all bits zero, in all |contexts, period, and so that you could not, for example, |say, |char *i; |int j; |scanf("%d",&j); |i = (char *) j; |and end up with something other than a null pointer if you input |0 to the scanf, then there would be a lot less discussion in comp.lang.c. What in the world are you going to do with a pointer value that you read from a file? The only useful information you could get would be to note whether it was zero, which you hope to equate to a nil pointer. This purpose might be better served by using a flag instead: it doesn't purport to carry more information that it really has, and it doesn't rely on nil pointers being all-bits-zero. -- Steve Clamage, TauMetric Corp, steve@taumet.com