Is there any way of making a for
loop iterate a fixed number of times, even though the right side of the interval might be increasing ?
I want to do this without declaring an additional variable to use as a copy of the initial inc
.
For example:
for (i = 0; i < inc; i++)
{
if (condition)
{
inc++;
}
}
I am pretty sure that if inc
increases, the for will execute more than inc - 1
times. How can I iterate exactly inc
times, without using a copy of inc
?