I remember this part but I can't just figure it out.. My current code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/* Make a program that keeps printing the multiples of the integer 2. */
cout << " " << total << endl;
Bufflez, that happens because you close the terminal before it gets a chance to load the program, the terminal processes is still active, you need to kill it through a task manager, then you re-run it.
I use infinite loops frequently, just breaking out of them when I need to, it's better than goto and uses less memory than if I had some arbitrary bool value for every while loop.
Code::Blocks is a special case because it doesn't run the program directly. You'll notice that at the end it displays its run time and waits for a key press. The regular console doesn't do this. What Code::Blocks does is run a program that itself runs the user's program. Now, what happens to the child process, I have no clue.
Zephilinox, if you 'x' out a running program in Code::Blocks in debug mode, it is still "debugging". To stop the debug process, you need to "abort" it. It's on the line where there is also a button for "compile" and "run" and such.
you can either do what I suggested, and kill it via a terminal or gui application (in Windows 7 press ctrl-shift-esc, click processes tab, find program, end process), bools suggestion of pressing abort (which hasn't worked for me in the past, but may for you) or as a last resort restart your PC.