Where is ptrdiff_t defined in C?

CTypesLibcStdint

C Problem Overview


Where is ptrdiff_t defined in C?

C Solutions


Solution 1 - C

It's defined in stddef.h.


That header defines the integral types size_t, ptrdiff_t, and wchar_t, the functional macro offsetof, and the constant macro NULL.

Solution 2 - C

It is defined by the POSIX standard: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html Where the type is exactly may be implemetation-specific, but interface is stddef.h

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMatt JoinerView Question on Stackoverflow
Solution 1 - CGManNickGView Answer on Stackoverflow
Solution 2 - Cuser933161View Answer on Stackoverflow