I see now that you’ve edited your question (which was about 4 UInt8
instead of 5).
If you show code, please surround it in triple backticks (```) to make it easier to read & follow, and ultimately to make it easier to help you.
I’m not sure using memcpy
to interpret 5 bytes as two Int32
works in C either - you’ll interpret bytes outside of the array as part of the last Int32
, which is a dangerous thing (and probably undefined behavior as well). Where do you get those bytes from? What do you want to do with them?