Assuming Codeblocks is correctly set up to see your compiler and debugger, make sure you are compiling with debugging symbols (you can set this globally by in Settings>Compiler>Global compiler settings>Compiler settings tab by checking the "Produce debugging symbols" checkbox or by enabling that option in your project's build options either project-wide or on a per target basis). If you just enabled debugging symbols, rebuild the project (Build>Rebuild). Then you can launch the program in the debugger (click the red play button in the debugger toolbar or use Debug>Start). When your program crashes, the debugger should pull up the line of code where the crash occurred (as long as it's within your source code that was build with debugging symbols). You can then add debugging watches to look at the values of variables at that point of execution. You can also set breakpoints at/before that point of failure and restart the program through the debugger so that the execution of your program pauses and you can see the values of watches or step through the program line by line, etc. If you want to start the program with specific command line arguments, you can set those in "Project>Set program's arguments".