In ruby, I have seen the following.
10.times {
# do this block 10 times
}
With this, (as far as I know, which is not much relative to ruby) there is no loop iterator. In C based languages, the closest replica I can come up with is a simple for loop.
for (int i = 0; i < 10; i++) {
// do this block 10 times
}
But this utilizes the loop iterator, i
. Is there any way in C based languages (including those listed in the tags) to execute a block of code a multiple number of times without the use of an iterator?
For example: If I wanted to execute a block a certain number of times, but did not care which iteration I was on.