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