Re:Comp.lang.c Frequently Asked Questions
by SAI_Peregrinus on Sunday September 12, 2021 @06:10PM
(#28505505)
Because C doesn't really have indexes, it has pointers and offsets. offset_t would make more sense than index_t.
[ Parent
| on HN ]
Re:Comp.lang.c Frequently Asked Questions
by ohazi on Sunday September 12, 2021 @07:07PM
(#28505930)
There's also ssize_t and ptrdiff_t for offsets that might be negative. Use is pretty nuanced, read the docs before using, etc.
Re:Comp.lang.c Frequently Asked Questions
by SAI_Peregrinus on Sunday September 12, 2021 @08:40PM
(#28506619)
And intptr_t and uintptr_t for results of computations resulting in pointers. Sadly C's type system isn't really powerful enough to properly take advantage of these.