struct size is different from typedef version?
- by samoz
I have the following struct declaration and typedef in my code:
struct blockHeaderStruct {
bool allocated;
unsigned int length;
};
typedef struct blockHeaderStruct blockHeader;
When I do sizeof(blockheader), I get the value of 4 bytes back, but when I do sizeof(blockHeaderStruct), I get 8 bytes.
Why is this happening? Why am I not getting 5 back instead?