I need a translate (in both directions) all primitive types, into char (will be stored in string)
I understand how to manipulate integral types with bits and I cant just cut them down and shift them, but float and double don't work with this manipulation. So does anyone know how I can create a perfect bit copy of float and double?
This did come to mind but with using the reinterpret_cast to check for errors, however I thought that the compiler might complain, or that if this is allowed that maybe Windows would have rules about its memory handling and prevent this from working during runtime
I don't think there's anything that avoids this to be good on known systems like Windows.
Windows itself likes to cast pointers to other types (see Handles like HWND, HMODULE itself is a pointer to IMAGE_DOS_HEADER).
Also I think it should be reinterpret_cast.
dynamic_cast is for checking compatibility between virtual classes.