Save bytes in float variable

have a look here: reinterpret_cast conversion - cppreference.com

When it is needed to interpret the bytes of an object as a value of a different type, std::memcpy or std::bit_cast (since C++20) can be used

I suggest we stop hijacking the OP's thread and any discussion on this could be in a new thread

1 Like