tags:

views:

168

answers:

4
+4  A: 

There is no limit to how many times a loop may loop. There are limits to the max and minimum values of an int, and those may play into your loop. In this case, 800 should be fine, so there is something else going on here.

Edit: Works for me... the only weird thing I see is that you reset X inside the innermost loop, so the output is always the last integer entered if it's >0, or 0.

Thanatos
yeah, made a mistake there. hey could you do me a favor since your one's working.paste the entire text of the file here into the console - http://terminusbound.com/e.inif it doesn't hang then let me know.
Daal
+2  A: 

Are you piping input to this program? There may be some buffering limitation with that. Try putting the data in a file and read from the file.

Brian Ensink
I'm pasting all at once. I guess you can call that piping.
Daal
Try piping the file to your program instead of pasting. There may be a limit to how much data you can paste.
tomlogic
@tomlogic - You took the words right out of my mouth. In other words, 100% agree.
Heath Hunnicutt
+1  A: 
Heath Hunnicutt
A: 

It's common practice to loop 10,000 times or (much) more to compare the performance of two small calculations.

If there was a limit, there wouldn't be such as thing as an infinite loop. ;)

Lachlan