Re:Nearly All Binary Searches and Mergesorts Are Broken (2006)
by lamp987 on Friday November 18, 2022 @07:31PM
(#33665161)
you need to google why size_t exists.
size_t guarantees you to be able to represent any array index. unsigned int can be arbitrarily tiny and a bigger loop may cause unsigned overflow during your loop on some architectures. in other words, your code would be broken. size_t will make it work correctly everywhere. it is the correct way of representing array indices.
[ Parent
| on HN ]
There are no comments on this comment yet.