M
Michael Mair
^^^^^^^^^^^^^^^^^^^^^^^Foobarius said:That's unusual...it disagrees with 5.10 in C FAQ, which says NULL is a
stylistic convention, and guarantees 0's to be null pointers.
What Richard probably is referring to is the fact that neither
NULL nor 0 are _pointers_ but are interpreted as a null pointer
constant. 0, as it is, is an integer value. If this is converted into a
pointer, anything can happen to the actual value of the pointer.
That means
int i, ptr=NULL;
unsigned char *rep;
rep=&ptr;
for (i=0; i<sizeof ptr; i++)
printf("%x\n",(unsigned int) (*rep++));
will not necessarily give you
0x0
0x0
....
So, what I marked above, is *wrong*.
Just out of curiousity, why would NULL be defined as 48?
NULL is never defined as 48 but the actual representation of
a "pointer that does not point anywhere" is not necessarily 0.
If it is a valid address that is during runtime interpreted
as null pointer, it is not necessarily "byte zero" or "segmentffset
with offset 0".
Cheers
Michael