Is it possible to copy a 32 bit value into an array of 8 bit characters with a single assignment?
Say I have a byte array (uint8*) with the contents:
01 12 23 45 56 67 89 90
Is it possible to copy into this array (through casts or something) with a single assignment?
For example, copy something like 0x555555, so that we end up with:
55 55 55 55 56 67 78 90
Beware of the size of int under 64-bit code… you will need to find a data type that is consistently 32 bits under both architectures, such as
uint32_t.