4 ms·
> Why use a for loop with a bound as an example instead of while loops with linked lists? I'm the author of the example. I wanted to keep it as simple as possi
by teo_zero 11d ago
> Why use a for loop with a bound as an example instead of while loops with linked lists?
I'm the author of the example. I wanted to keep it as simple as possible, and this is the most common form of for loop. I was sure that HN readers would be clever enough to "map" it to whatever they have in their mind that satisfy the undecidability of the condition.
But since you're nitpicking, I haven't specified the types of i and n: i is uint8_t and n is uint32_t. Does it terminate? It depends on the value of n!