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