I think the main purpose of the OP was to explain how without the help of anything other than your C compiler, you can locate your own segfaults. Not everyone has a debugger or something like electric fence to hunt them down for them. However, by sprinkling printf statements through your code, you can usually hunt them down yourself without too much trouble.

One thing you might want to add however, is that you may want to be sure and flush the output stream to be sure what you're printing does in fact show up.

Quzah.