Q: What does a run-time ``null pointer assignment'' error mean? How can I track it down?
A: This message, which typically occurs with MS-DOS compilers, means that you've written, via a null pointer, to an invalid location--probably offset 0 in the default data segment. (The pointer in question might have been uninitialized, although as we saw in question 1.30, not all uninitialized pointers necessarily start out as null pointers.)
A debugger may let you set some kind of data watchpoint on location 0. Alternatively, you could write a bit of code to stash away a copy of 20 or so bytes from location 0, and periodically check that the memory at location 0 hasn't changed. See also question 16.8.