Loop goes infinitly

Pages: 12
copying the code just gave the same result. I have the latest version of
code blocks/MinGW which is 12.11.
Read my post 2 posts back.

"Maybe your program was not shut down correctly after you compiled it, before your code was fully complete, and it's still open on your machine from the original. Try opening task manager, and going to your processes tab and terminating any process that resembles this program you made, and re compile and run again, also delete the executable file first. "

Also look in your anti-virus software for a software black list, and see if your program is in there, or add it to a white list. Because as I said, Avast thought your code was a virus when I originally compiled and ran it.
Last edited on
closed account (3qX21hU5)
Well then I can't really help you since it is not code related it seems, or it is way over my skill limit. Because the code you posted should work, the only time you would get a infinite loop would be when you enter anything that is not a integer.

And the code I had you copy and paste would handle the stream failures that usually cause a infinite loop. So sorry I can't help you best advice would be to try re installing maybe.

Another option would be to do clean on the executable and then try running the program again. To do this in codeblocks you go up to "build"->"clean" and then recompile the program and run it again. Not sure if this will work but worth a try.
Last edited on
Step by step instructions:

1) Recompile the program after cleaning everything up
if that doesn't work...
2) Reinstall Code::Blocks
if that doesn't work...
3) Reinstall Code::Blocks with the TDM compiler
if that doesn't work...
4) Reinstall Windows
if that doesn't work...
5) Get Linux
if that doesn't work...
6) You can throw your computer away :D
The only thing that I find weird is the fact that it goes into an infinite loop after when I hit enter for the 7th time even if I didn't input anything. I can't think it would be my pc because I get the same error on another pc.
Well I think it's your PC, because everything is fine on my 7 year old IBM laptop running linux :)
Last edited on
@ Vidminas - lol

Did you try to terminate any instances of the program in processes Astro, and re-build? If that doesn't work, I don't believe it and Vidminas may be right.

If that didn't work, restart your computer and recompile and run
If that doesn't work, follow Vidminas's instructions
If that doesn't work, dig your computer out of the trash and beat it with a large sledgehammer
Last edited on
I reinstalled codeblocks with no better result and how do I install code blocks with the TDM compiler?

I'd throw away my computer if I knew I'd have another one :D
Last edited on
You never checked your processes did you, lol. Somebody on a separate forum had this problem and did what I said and it worked. That's the only reason I want you to try it.
Ok, start fresh, which means
- Un-install Code::Blocks
- Remove all projects and other directories associated with it (keep backups if you need to, but put them somewhere else)
- Perform clean up
- Reboot your PC
- Install Code::Blocks without MinGW
- Install TDM compiler (get 32-bit for simplicity) where you want
- Open Code::Blocks, go to settings -> compiler
- Click auto-detect and reset to defaults (it should find your TDM installation)
- Set the settings right in settings -> debugger
- All done!

Keep in mind - this might not help, because we can't really help you, we're just suggesting random ideas that could be relevant...
Last edited on
I checked my proccess's but nothing so the program does close and I am just checking where exactly on my antivirus the whitelist is, lol.
The last thing I can tell you is that "infinitly" is spelled "infinitely" :D
I will try what you said about cleanup but tnx all for helping!

EDIT: I managed to fix the problem! Just had to uninstall, run registry fixer, download codeblocks again, restart pc, install codeblocks, restart pc again and then run codeblocks and it works!!! Tnx sooo much for helping all.
Last edited on
Topic archived. No new replies allowed.
Pages: 12