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