GDB The most standard debugging tool on UNIX is the GNU Debugger gdb. Its main functionnality is to display the piece of code which procuced a crash. To do it, compile your code with the -g option, so that debugging information will be added to the executable. This information is mainly a correspondance between the machine langage instructions and locations in the source. Then, execute the program from gdb. For instance int main(int argc, char **argv) { int size = 100; int a[size]; for(int i = 0; i < 100 * size; i++) a[i] = i; } > g++ -o bang -g bang.cc > gdb ./bang
Learn C++ Programming fast and easy, find C++ Program Codes