C and C++ could have non_nullable pointers, easily
Posted Aug 21, 2009 8:00 UTC (Fri) by hppnq
In reply to: C and C++ could have non_nullable pointers, easily
Parent article: Null pointers, one month later
Once it's a non-null pointer, it becomes legal to dereference.
This assumes that pointers do not change, which is only true in the trivial cases. If you want to be completely safe, your only option is to always check, right before using it, that a pointer is not NULL.
And then, by the way, you still have to worry about what will happen it turns out to be pointing to 0x1. ;-)
to post comments)