#include <stdio.h>
typedef struct
{
int a;
char c;
int d;
}t;
typedef struct
{
int a;
char c;
char d;
char e;
int f;
}t1;
int main()
{
printf("sizeof t = %d", sizeof(t));
printf("sizeof t1 = %d", sizeof(t1));
}
Output:
sizeof t = 12
sizeof t = 12
Without using #pragma pack(), sizeof operator is returning same value for two different structure. Could you please explain?