An "infinite loop" is a loop in which the exit criteria are never satisfied; such a loop would perform a potentially infinite number of iterations of the loop body. The general problem of determining whether the execution of a loop with given preconditions will result in an infinite loop is undecidable; in other words, there is no algorithm to determine whether an execution of a loop will eventually terminate. This is known as the halting problem.
Questions tagged [infinite-loop]
3528 questions
1
vote
2 answers
atoi() method, char * cout
This is an atoi() I am trying to understand. In order to compile with the non-existing library, I called it m().
There are several lines of codes I am confused about, mainly char * issues.
My questions are listed after the code:
#include…

HoKy22
- 4,057
- 8
- 33
- 54
1
vote
4 answers
While loop with scan in C
So my question is the following.
int n=0;
while(n<=0)
scanf("%d",&n);
This code enters in an infinite loop, and I don't have a clue why. When the user inputs a number > 0, the loop was supposed to stop.
And thanks:)

user2116077
- 13
- 1
- 5
1
vote
6 answers
what to do when windows goes in dreaded 100% cpu usage zombie mode
happens to me occasionally:
I start my program in visual studio and due to some bug my program goes into 100% cpu usage and basically freezes windows completely.
Only by utter patience requesting the task manager (takes forever to come up and paint…

Toad
- 15,593
- 16
- 82
- 128
1
vote
2 answers
infinite loop in applescript stops logout
So I am writing a basic applescript to end a very annoying program that randomly opens and interrupts me while Im working. The program needs to stay but i don't want to see it. I want my script to open automatically when the computer restarts (I…

user1074202
- 139
- 1
- 4
- 14
1
vote
2 answers
Infinite Loop or Early terminating do while loop
I have been fighting with this program for awhile now. It has started to compile correctly, but when I run it as it is, it says "Your bill is __" infinitely. When I change the initial response value it refuses to run. I'm at a lose as to how to…

SMoore
- 23
- 1
- 6
1
vote
2 answers
Check for infinite calls/recusrive calls algorithm
This is a subset of the problem I am trying to tackle. Assume that I have parsed some code and now I am trying to check if it is logically correct. One of those checks is that functions calls can't call themselves or be involved in another function…

Andy M
- 119
- 9
1
vote
1 answer
infinite loop in python interpreter
I'm following along with python official tutorial.
I've created a fibonacci function fib() as shown on the tutorial,
The output from the function given argument 1 was(to my surprise),
infinite trails of 0.
>>> def fib(n):
... a, b = 0, 1
... …

Yeonho
- 3,629
- 4
- 39
- 61
1
vote
1 answer
There is an Endless loop about forEach and map when I learning eloquentjavascript
chapter6
My english is poor can't describe the problem in detail so I paste my practice code:http://jsbin.com/exusox/3/edit
Endless loop when you click the butten.
I've tested my code,I found the endless loop in this code:
function…

user1573365
- 135
- 6
1
vote
3 answers
PyGtk3 ~ Allowing a signal from the user, but not the programmatically
My question is related to PyGObject, Gtk3 and signal suppression.
I have a ComboBoxText, with a signal connected.
self.cbtPaths = Gtk.ComboBoxText()
self.cbtPaths.connect("changed", self.on_changed_path)
def on_changed_path(self,action):
path =…

Anthony Scaife
- 564
- 5
- 15
1
vote
3 answers
Why is else statement a infinite loop?
I am fairly new to Java and I am trying to work on my data validation. The code runs fine when I use valid data, but when I put in a string instead of an integer the code just loops forever. It just loops the, "Bad input. Please enter a number."…

user1939469
- 41
- 4
1
vote
1 answer
Infinite loop in Fortran
This is my code in Fortran 90
program final
implicit none
real, dimension(421,422) :: a
real :: temp,factor
real, dimension (421) :: soln
integer :: i, rmax, pivot, row,n, O,P,COL,k,a_j,n2,a_i,t
…

Jamie
- 11
- 2
1
vote
1 answer
Drupal, hook_node_view and search create infinite loop
I am having a very strange problem with drupal. I have a custom module that does a goto if you view a node of a certain type (see code below). The problem is, after a while I get in an infinite loop where the datafile_flow_node_view is called…

Nealv
- 6,856
- 8
- 58
- 89
1
vote
2 answers
Backbone infinite loop when creating models
I'm doing something pretty standard, I think.
Model:
app.model.Todo = Backbone.Model.extend({
defaults: {
task: ''
, completed: 0
, attachments: []
, note: ''
}
});
Collection:
var Todos =…

Oscar Godson
- 31,662
- 41
- 121
- 201
1
vote
3 answers
Infinite for-loop
int i = 0;
double n = 1.24;
for (; int(n) != n; i++) {
n *= 10;
}
Why does it enter an infinite loop? Shouldn't it stop after two loops?

fpiro07
- 847
- 1
- 13
- 18
1
vote
1 answer
htaccess internal errors with using (escaped or unescaped) dots
Maybe I'm doing something stupid, but I can't get rid of an issue with htaccess.
I'm trying to match a function name in a documentation site and I'm getting errors I can't understand. I must point that I (think I) know about regular expressions…

Áxel Costas Pena
- 5,886
- 6
- 28
- 59