Suppose I have this array:
uint8_t arr[10];
located at address 0x00
.
Then I want to assign part of it to uint32_t value. Aggregatin of arr[1], arr[2], arr[3] and arr[4] to 32 bit integer. Here is an example:
uint8_t arr[10];
uint32_t i;
i = *( (uint32_t *)&arr[1] );
What bothers me is that arr[1]
is located at address not multiple of four(at address 0x01). So the question is: what would happen on 32bit platform? Is this legal, does it have some disadvantages compared to standard uint32
assignments?