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