#include <stdio.h>
typedef struct {
char a;
int b;
short c;
} MyStruct;
void print_offsets() {
MyStruct mst;
char* base = (char*)&mst;
printf("Offset of a: %lu\n", (char*)&mst.a - base);
printf("Offset of b: %lu\n", (char*)&mst.b - base);
printf("Offset of c: %lu\n", (char*)&mst.c - base);
printf("Size: %d\n",sizeof(mst));
}
int main() {
print_offsets();
return 0;
}