#include <stdio.h>
typedef struct {
char a;
int b;
short c;
} MyStruct;
void print_offsets() {
MyStruct t;
int boff = (char*)&t.b - (char*)&t;
int coff = (char*)&t.c - (char*)&t;
int size = sizeof(t);
printf("Offset of a: 0\nOffset of b: %d\nOffset of c: %d\nSize: %d", boff, coff, size);
}
int main() {
print_offsets();
return 0;
}