I am wondering how to do converts between unsigned base 16 numbers and signed base 10 numbers?
For example
5d0cfa30041d4348 <-> 6705009029382226760
024025978b5e50d2 <-> 162170919393841362
fb115bd6d34a8e9f <-> -355401917359550817
By the way, they are actually IDs of some items. And internally they are all 64-bit numbers, but in two presentations.
Any classes I can use of ?
Thanks
If the base 16 value is a constant or stored in a variable a simple cast will work.
If the value is a string it will just need to be scanned first.
Note: the
scanHexLongLongand other scan methods return a BOOL for whether or not the scan was successful. If working with strings it would be best to check that the scan succeeded.