Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years ago.
The size of a struct
I have a struct as given, When I get the sizeof the struct with the code, I get 16 Bytes. printf("\nSize of PACKHEADER, %d", sizeof(PACKHEADER));
I am using LPC1768 microcontroller.
Why doesn't it give 14 Bytes? struct PACKHEADER { uint8_t b; uint8_t m; int32_t fsize; int32_t reserved; int32_t ofset; };
1 Answer
5 years ago.
Hi there, probably Data structure alignment
Best regards
J.