#include <stdio.h>
typedef struct Info1 {
int n; // 4
short st; // 2
char ch; // 1
char s[5]; // 5
int *p; // 8
} Info1;
#pragma pack(1)
typedef struct Info2 {
int n; // 4
short st; // 2
char ch; // 1
char s[5]; // 5
int *p; // 8
} Info2;
int main(void) {
int a;
Info1 inf1 = {812, 17, 'n', "c c++", &a};
Info2 inf2 = {812, 17, 'n', "c c++", &a};
printf("Size: %llu\n", sizeof(inf1));
printf("Size: %llu\n", sizeof(inf2));
return 0;
}
/*
run:
Size: 24
Size: 20
*/