3 ms·
Because C doesn't really have indexes, it has pointers and offsets. offset_t would make more sense than index_t.
by SAI_Peregrinus 5y ago
Because C doesn't really have indexes, it has pointers and offsets. offset_t would make more sense than index_t.
- ohazi 5y agoThere's also ssize_t and ptrdiff_t for offsets that might be negative. Use is pretty nuanced, read the docs before using, etc.
- SAI_Peregrinus 5y agoAnd 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.