|
offsetofmacro
<cstddef> offsetof (type,member) Return member offset This macro with functional form returns the offset value in bytes of member member in the structure type type.The value returned is an unsigned integral value of type size_t with the amount of bytes between the specified member and the beginning of its structure. Because of the extended functionality of structs in C++, in this language, the use of offsetof is restricted to "POD types", which for classes, more or less corresponds to the C concept of struct (although non-derived classes with only public non-virtual member functions and with no constructor and/or destructor would also qualify as POD). Parameters
Return valueA value of type size_t with the offset value of member in type.Example
Output:
|