4 ms·
That's the idiomatic way? Cool. The more straightforward-looking way, for(i = n-1; i >= 0; i--) { /* operate on a[i] */ } breaks if i is unsigned,
by ramshorns 6y ago
That's the idiomatic way? Cool. The more straightforward-looking way,
for(i = n-1; i >= 0; i--)
{ /* operate on a[i] */ }
breaks if i is unsigned, like a size_t.
- a1369209993 6y agoYep. That why it's a idiom, rather than a obvious-way-of-doing-it-that-anyone-competent-would-use.