offsetof(3) Library Functions Manual offsetof(3) offsetof - LIBRARY Standard C library (libc, -lc) #include size_t offsetof(type, member); offsetof() member type. , , , , . , . member (.., ), . offsetof() member type. C11, POSIX.1-2008. POSIX.1-2001, C89. Linux/i386 gcc(1) : $ ./a.out offsets: i=0; c=4; d=8 a=16 sizeof(struct s)=16 #include #include #include int main(void) { struct s { int i; char c; double d; char a[]; }; /* Output is compiler dependent */ printf("offsets: i=%zu; c=%zu; d=%zu a=%zu\n", offsetof(struct s, i), offsetof(struct s, c), offsetof(struct s, d), offsetof(struct s, a)); printf("sizeof(struct s)=%zu\n", sizeof(struct s)); exit(EXIT_SUCCESS); } Azamat Hackimov , Konstantin Shvaykovskiy , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . offsetof(3)