#include <stdio.h>
typedef struct {
char a;
int b;
short c;
} MyStruct;
void print_offsets(void)
{
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: %d",sizeof(MyStruct));
}
int main() {
print_offsets();
return 0;
}