#include <stdio.h>
typedef struct {
char a;
int b;
short c;
} MyStruct;
void print_offsets() {
MyStruct size;
int Offset = 0;
int a_size = sizeof(size.a);
int b_size = sizeof(size.b);
int c_size = sizeof(size.c);
if (a_size > 4) {
Offset = a_size + a_size % 4;
}
printf("Offset of a: %d\n",Offset);
Offset+=4;
if (b_size > 4) {
Offset += b_size + b_size % 4;
}
printf("Offset of b: %d\n", Offset);
Offset+=4;
if (c_size > 4) {
Offset += c_size + c_size % 4;
}
printf("Offset of c: %d\n", Offset);
Offset+=4;
printf("Size: %d\n", sizeof(size));
}
int main() {
print_offsets();
return 0;
}