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