As said in the "How can I configure Codeblocks to not close the console after the program has finished?" question:
Project -> Properties -> Build targets
. You should see a checkbox labeled:Pause when execution ends
somewhere there. Your application type must beConsole application
.