2 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 3mo 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 3mo agoIt works perfectly fine for size = 0?
- xigoi 3mo agoThey meant x = 0.
- layer8 3mo 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 3mo ago[dead]