Reputation: 8967
Is there a clean way to skip several iterations from a from a for
loop?
Something like:
for (int i = 0; i< count; i++)
{
if (condition)
{
// skip several iterations of "i"
continue(5);
}
}
Upvotes: 0
Views: 197
Reputation: 43023
You can change the value of i
, that will skip some iterations:
for (int i = 0; i< count; i++)
{
if (condition)
{
i+=5;
continue;
}
}
Upvotes: 2