1.6. Common definitions <stddef.h>

The following types and macros are defined in the standard header <stddef.h>. Some are also defined in other headers, as noted in their respective sub clauses.

The types are:

ptrdiff_t

which is the signed integral type of the result of subtracting two pointers,

size_t

which is the unsigned integral type of the result of the sizeof operator: and

wchar_t

which is an integral type whose range of values can represent distinct codes for all members of the largest extended character set specified among the supported locales: the null character shall have the value zero and each member of the basic character set defined in ANSI C 5.2.1 shall have a code value equal equal to its value when used as a lone character in an integer character constant.

The macros are:

NULL

which expands to an implementation-defined null pointer constant: and

offset_of(type, member-designator)

which expands to an integral constant expression that has type size_t, the value of which is the offset in bytes, to the structure member (designated by member-designator), from the beginning of its structure (designated by type). The member-designator shall be such that given static type t; then the expression &(t.member-designator) evaluates to an address constant. (If the specified member is a bit field, the behavior is undefined.)