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