8 ms·
> I really don't see what's supposedly awful about that loop Exactly! That's precisely the problem with it. (Hint: think about your code when size = 0.)
by StellarScience 2mo ago
> I really don't see what's supposedly awful about that loop
Exactly! That's precisely the problem with it.
(Hint: think about your code when size = 0.)
- layer8 2mo agoIt works perfectly fine for size = 0?
- xigoi 2mo agoThey meant x = 0.
- layer8 2mo agoNot sure if they meant that, since the “awful” was referring to the original loop that had no x, but the generic solution in that case is: for (size_t i = size; i—- > x;)
- StellarScience 2mo ago[dead]