Re:About size_t and ptrdiff_t
by tomvbussel on Tuesday August 18, 2015 @01:29PM
(#10080649)
ssize_t is not a part of the C++ standard, sadly.
Re:About size_t and ptrdiff_t
by throwaCagain on Tuesday August 18, 2015 @01:31PM
(#10080673)
Just POSIX :).
ssize_t isn't standard C so it doesn't get you very far for portability.
Re:About size_t and ptrdiff_t
by throwaCagain on Tuesday August 18, 2015 @01:35PM
(#10080709)
POSIX gets you pretty far.
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.