> Does C++ check whether a pointer you're deferencing is zero? Or will it
> just segfault?
In practice it segfaults. Any time you think there's even a chance of this
happening, do
assert( ptr );
to catch it ahead of time. (This will assert that it is not 0, or NULL).
You'll save yourself some headaches.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|