Possible Duplicate: Why isn't sizeof for a struct equal to the sum of sizeof of each member?
In the following code, the value of structSize
is different depending on whether it's executed on an Arduino vs my PC (Ubuntu 11.04 x64).
struct testStruct{
uint8_t val1;
uint16_t val2;
};
...
uint_8_t structSize = sizeof(testStruct);
On my PC, the value of structSize
is 4, and on my Arduino the value of structSize
is 3 (as expected).
Where is this 4th byte coming from?