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