Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. int iNum = 17706;
  2. // convert to long little endian hex
  3. long lNum = (long)_byteswap_ushort(iNum);
  4. // convert to string??
  5.  
  6. long iNum = 17706;
  7. // convert to long little endian hex
  8. long lNum = (long)_byteswap_ulong(iNum);
  9. // convert to string
  10. std::ostringstream oss;
  11. oss << std::hex << lNum;
  12. std::string mystring = oss.str();
  13.  
  14. while (iNum != 0) {
  15. int byte = iNum & 0x0F;
  16. std::cout << std::hex << byte;
  17. iNum /= 16;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement