HP C/iX Library Reference Manual (30026-90004)

264 Chapter5
HP C/iX Library Function Descriptions
offsetof
offsetof
Finds the offset of a member in a structure.
Syntax
#include <stddef.h>
offsetof (
type
,
member
);
Parameters
type
The name of a structured data type.
member
The name of an element within the data structure
type
.
Return Values
x The byte offset of
member
within the structure
type
returned as an
unsigned integer of type size_t.
Description
The offsetof macro calculates the offset in bytes of
member
from the beginning of the
structure (
type
). The value returned is a variable of type size_t, which is defined in
<stddef.h>.
See Also
ANSI C 4.1.5