You should learn to use CODE tags to post readable code.
Quote:
Originally Posted by Carlos2313
It is not stopping, so it's giving me the previous error.
|
I don't think you have posted the right information to let us diagnose the problem.
Code:
if(store >= 1)
break;
Quote:
How can I stop the program if in the cycleI'm already defining that it should stop when the result equals or is bigger than 1??
|
I assume you added a second way to break out of the loop (making the first way redundant) because you didn't think the first one was working.
So you seem to have some mental model of what is happening in your code (that store reaches 1 or higher and the loop keeps going). But you don't seem to really know what is happening. You could use a debugger, or add some temporary printouts, or add some "defensive programming". Any of those is better than guessing.
Code:
PoissonArr = (float*) malloc (sizeof(float)*10);
...
For example, defensive programming might follow
current++; with
Code:
if (current >= 10 ) {
printf("Exceeded size of array. Aborting.\n");
exit(-1);
}
Maybe a bit drastic (exit instead of return) but you get the idea.