Tagged Questions
1
vote
3answers
51 views
How can I break up a list in prolog, given a pivot?
I'm working on a small project to lean prolog. What I'm trying to do right now is, given a sentence, return a list of words. So, I'm taking in a character array, e.g. "highs and lows", and trying to ...
0
votes
1answer
31 views
Cannot insert an element in the concrete position and an infinite loop
I'm trying to include a char inside a bidimensional array, the problem is, that when I write the position for the element, the code seems to ignore it and the position is 0, 0 by default. Here's the ...
0
votes
1answer
53 views
array_search in 2D array cause infinite loop [closed]
I want to search in a 2D array. So create this function:
function array_search_2d($needle, $haystack){
foreach($haystack as $k => $h){
$key = array_search($needle, $h);
...
7
votes
5answers
297 views
Why is there an infinite loop in my program?
int main(void)
{
int i;
int array[5];
for (i = 0; i <= 20; i++)
array[i] = 0;
return 0;
}
Why is the above code stuck in an infinite loop?
0
votes
1answer
106 views
image arrays using JavaScript
I need help creating image arrays using JavaScript. I need to create an array of images to cycle through using their src attribute to cycle through them. Then the images need to be cycled to the next ...
0
votes
1answer
22 views
Controller/actuator to perform database actions by URL, loop never-ending
I'm writing a simple AJAX/jquery CMS for a website i'm building. To simplify everything, I want to simply make requests to URLs to perform actions (much like what Magento has - but I have my reasons ...
0
votes
4answers
99 views
Why is this for loop infinitely looping? (C)
This is really strange. This program was working fine on another computer, but when I try it on this one it runs forever. Also it is a for loop, which adds even more to my confusion. SIZE_OF_DATA is ...
-1
votes
1answer
135 views
Can't find where infinite loop occurs [closed]
I'm making a program where the user enters 30 days of closing stock prices and the program finds the lowest and highest price.
After the user enters the data the program won't continue.
double ...
0
votes
1answer
98 views
How to move through an array?
I need to move an index though an array to put an random array in order. Here is my code.
void insertNumber(int randomNum, int data[], int size)
{
int i = 0;
for(i = 0; randomNum > ...