GDB - The GNU Debugger!
The GNU Debugger, usually called just GDB and named gdb as an executable file, is the standard debugger for the GNU operating system. A debugger is regarded as the best friend of a software programmer. However, its use is not strictly limited to the GNU operating system. It is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, C, C++, Objective-C, Free Pascal, Fortran, Java and partially others. Even though GDB can help you in finding out memory leakage related bugs, but it is not a tool to detect memory leakages. GDB cannot be used for programs that compile with errors and it does not help in fixing those errors.
gdb nameofprogram #debugs program (from the shell)
run -v #runs the loaded program with the parameters