Consider I have 2 unsigned numbers, of 32 bits each, saved in a single array. The first number is contained in positions [0; 3] and the second in positions [4; 8]. I now which to change the value of one of the numbers, is the following code allowed/problematic?
uint8_t array[8];
//...Fill it up...
uint32_t *ptr = NULL;
ptr = (uint32_t*)&array[0];
*ptr = 12345;
ptr = (uint32_t*)&array[4];
*ptr = 54321;