Quick actions

cmd+k|ctrl+k

Navigation

Languages

STRUCT_OFFSET

Snippet info

Language

Cpp

Visibility

public

Author

evine

Created

2016-08-11T01:42:03Z

Updated

2016-08-11T01:42:03Z

#include <stdio.h>
#include <stdint.h>

struct bera{
    char a;
    uint64_t b;
};

struct vera{
    char a;
    char b;
    bera c;
};

#define STRUCT_OFFSET(struc, memeber) (&((struc *)0)->memeber))


int main() {
    printf("%llu, %llu", sizeof(vera), STRUCT_OFFSET(vera, c.b);
    return 0;
}
INFO