I am trying to convert a double to a little-Endian hex string or directly to a specific type of long (see below).
Previously, I was converting a predefined little-Endian hex string to a long as follows.
string hcommand = "01AC";
char * p;
long n = strtol(hcommand.c_str(), &p, 16);
This worked as desired.
Now I am trying to EITHER convert a double to a hexadecimal string in little-Endian (least significant byte first) form (to then replace hcommand in the code above) OR convert directly from double to the same type of long as seen above.
I tried this, it does not process the same as above.
double myDouble = 44033;
long hcommand = (long)_byteswap_ulong((int)myDouble);
Thank you.
I discovered that the results are identical once I convert _byteswap_ulong to _byteswap_ushort.