offsetof at compile time
The offsetof() macro is a compile-time construct. There is no standard-compliant way to define it, but every compiler must have some way of doing it. One example would be: #define offsetof( type, member ) ( (size_t) &( ( (type *) 0 )->member ) ) While not being a compile-time construct technically (see comments by user … Read more