How to debug in Codeblocks?
First set a breakpoint at the beginning of your code or codeblocks won't go line by line.
When you run your program with debug mode (check the menus) you should get some toolbars with controls to advance lines and view variables. You can you the value of a variable by hovering over it in your code.