3 ms·
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 reall
by tmoravec 2y 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.
- pcwalton 2y agoThe 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).
- Maxatar 2y agoFrom what I see, that book was published in 1988.
- frumplestlatz 2y agoThe language has evolved significantly, and we’ve learned a lot about how to write safer C, since that was published in 1988.