I wrote the following code just to verify what was written in one of the books I use to study c. the memory allocated to the first variable i.e character variable does not make sense. the memory allocated is 4 bytes instead of 1.can someone help me where did i go wrong?
struct book
{
char name;
int price;
int pages;
};
struct book b1={'a',23,45},b2={'d',56,34},b3={'e',38,79};
printf("%p\t %p\t %p\n",&b1,&b2,&b3);
printf("%p\t %p\t %p\n",&b1.name,&b1.price,&b1.pages);
0x7ffd4f9a0384 0x7ffd4f9a0390 0x7ffd4f9a039c
0x7ffd4f9a0384 0x7ffd4f9a0388 0x7ffd4f9a038c