Problem with memcpy
Hello,
I am having a problem with simple line of code. If I run code bellow, the result seems off.
//Main job of this code is to tranform hex into float
uint32_t hex = 0x3fc51eb8;
float f;
memcpy(&f, &hex, 4);If i go into Live Expressions i get that f = 0x1 (hex), it should be f = 0x3fc51eb8. The strangest thing is that the same code works for example on an onlineGDB compiler.
I assumed the trouble was within compiler, therefore I tried to change from default GNU 11 to some others, but there were no change. Any idea what could be wrong?
I am using:
NUCLEO G474
cubeIDE Version: 1.10.1 Build: 12716_20220707_0928 (UTC)