Doing things like having multiple cout commands adjacent to each other will cause it. Trying to assign a variable a value will do it. Trying to do basic math in the program will do it.
I know computers are very good at following the precise instructions you give them, which means I am telling it to do something I don't know that I am telling it. I am using Code::Blocks 13.12, the file name is main.cpp, and the compiler I told it to use is GNU GCC compiler. I am running Windows 8.1 on a 64 bit laptop. Is it perhaps I have bad compiler settings, or am labeling some metadata wrong, or something like that?
I know, that's the point, and why it is so frustrating.
Update: I just ran that code, plus the one in the link above, on another laptop I have that is running Ubuntu. Same version of Code::Blocks, same GNU GCC compiler. Both ran flawlessly. This seems to confirm it is a problem with the Windows laptop that I am not seeing. Does anyone have any ideas?