Hacker News new | ask | show | jobs
by tmoravec 448 days ago
size_t has been in the C standard since C89. "for (int i = 0..." might have it's uses so it doesn't make sense to disallow it. But I'd argue that it's not really a common textbook way to iterate over an array.
1 comments

The first example program that demonstrates arrays in The C Programming Language 2nd edition (page 22) uses signed integers for both the induction variable and the array length (the literal 10 becomes int).
The language has evolved significantly, and we’ve learned a lot about how to write safer C, since that was published in 1988.
From what I see, that book was published in 1988.