NULL question not in FAQ

Paul Shields shields at yunexus.YorkU.CA
Wed Mar 27 19:37:39 AEST 1991


phil at ux1.cso.uiuc.edu (Phil Howard KA9WGN) writes:

>Given that the compiler is supposed to translate the constant "0" to the
>appropriate value for a NULL pointer on the machine type, how does one
>get a pointer value whose representation happens to be all zeroes, but
>is a non-NULL pointer?

>Are all of these equivalent or are any differnt?
 [.. examples deleted..]

I think all the original examples are equivalent.  But if the stored 
value for a NULL pointer is something other than all 0 bits, then
erhaps this will do it...

     char *x;
     memset( &x, 0, sizeof(char *));



More information about the Comp.lang.c mailing list