|
|
|
|
|
by unwind
4892 days ago
|
|
If your for loop is for a 0-based language, it's wrong because it starts with 1. If it's for a 1-based language, it's wrong because it compares with "<" and not "<=". So, I guess that proves your point that it's error-prone. :) In C, the idiomatic way is (as you surely know) "for(i = 0; i < n; ++i)". |
|