-
stopping some scanning
what is the best way to stop scanning from a for loop.
i have a trigger that i have to use to stop the scanning but i am unsure how to use it.
i have to scan a bunch of numbers into an array and use '00000' to stop the scanning of ints and move on, anyone help?
thanks
-
You could use break.
Code:
for(i=0;i<1000;i++){
if(x==5){
break;
}
//More code
}
The break will exit out of the for loop.
- Sean
-
thank you
know another problem i am having is, i have stored the data in the array.
how do i go about adding all the individual numbers in the array.
here is what i tried
Code:
for (row = 0; row < numofInts; row++)
{
sumofInts += numbers[row];
}
-
It looks okay to me, what isn't working properly?
-Prelude
-
i got it now, thank you for your time.