3 ms·
This may be practically correct, but is semantically very very wrong. size_t represents the size of objects in memory. So of course it scales with virtual memo
by aCthrowa 11y ago
This may be practically correct, but is semantically very very wrong.
size_t represents the size of objects in memory. So of course it scales with virtual memory space.
ssize_t is like size_t (same width), but signed. It's useful for routines that want to return a size_t or error (network routines like send/recv).
ptrdiff_t is specifically for the result of subtracting one pointer from another. Obviously it scales with pointer size as well.
- tomvbussel 11y agossize_t is not a part of the C++ standard, sadly.
- throwaCagain 11y agoJust POSIX :).
- ben0x539 11y agossize_t isn't standard C so it doesn't get you very far for portability.
- throwaCagain 11y agoPOSIX gets you pretty far.