Title. Need to put bridgeSymbol hex value into myVariable memory buffer. I've tried every cast that came to my mind (bit_cast, reinterpret_cast).
Expected result should be hex value of (float)bridgeSymbol at myVariable pointer address.
What I'm missing?
uintptr_t myVariable = 0xC70BBF5C;
float bridgeSymbol = *(float*)(&myVariable); //Big endian -35775.36 OK!
bridgeSymbol = bridgeSymbol / 10; //some random operation = -3577.5
myVariable = (uintptr_t)bridgeSymbol; //expected 0xc55f9800 but getting random values
Edit 1: More detailed explanation as suggested.