Namespaces
Variants
Views
Actions

offsetof

From cppreference.com
< c‎ | types
Revision as of 14:24, 2 November 2012 by P12bot (Talk | contribs)

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <stddef.h>
</td>

<td></td> <td></td> <tr class="t-dcl ">

<td class="t-dcl-nopad">
#define offsetof(type, member) /*implementation-defined*/
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

The macro offsetof expands to a constant of type size_t, the value of which is the offset, in bytes, from the beginning of an object of specified type to its specified member, including padding if any.

See also

Template:c/types/dcl list size t
C++ documentation for offsetof