Debugging with GDB
Of the available tools for developing C applications, GDB (Gnu Debugger) is one of the more common. GDB is a command-line tool for C and C++, intended to help you find bugs in an application. It takes a while to learn how to make the most out of GDB, but if you do much C programming, doing so will pay off.
Programming for Easy Debugging
There are steps you can take to minimize the amount of debugging you have to do or to assist in the process when it does occur. The best practices include