- 0xCFCFCFCF and 0xDFDFDFDF are pretty high in system memory, so
dereferencing them is likely to cause a SigSegV.
There’s no guarantee that your selector is going to base anything at
0x000. 0xcfcfcfcf may not be 3GB away. It boggles the mind why anyone
would want to do anything that could even have a remote possibility of
being valid when the NULL approach is infallible. Plus, some
OSes/environments allocate data and code separately - some together, and
some are initialized to default differently as well. Working off non-known
state data is a BAD thing.
- They are NOT NULL (or 0) so they can’t be detected with “if(ptr)
{printf(ptr->string);}”… This is IMPORTANT because you SHOULD NOT be
trying to read from uninitialized memory… especially to determine IF
it has valid data.
I’m really confused on this one. If you’re trying to determine if it has
valid data, how would you know when one nonzero pointer is valid and one
nonzero pointer is not, whereas 0 is always invalid?
- When the program crashes, it’s pretty easy to look at the stack and
figure out what happened…
By the time the program crashes, you’re well and gone from where the real
problem ocurred, whereas a NULL is catchable every time.
–>Neil-------------------------------------------------------------------------------
Neil Bradley What are burger lovers saying
Synthcom Systems, Inc. about the new BK Back Porch Griller?
ICQ #29402898 “It tastes like it came off the back porch.” - Me