iphone - Objective-C Decimal to Base 16 Hex conversion -


Do anyone have a code snippet or a class that will take a long time and convert them into 16 bytes hex string?

I want to change the data like this

  long decimal decimals = 1719886131591410351;  

and turn it on in

  // Base 16 hex output: 17DE435307A07300  

% x not operator Does not want to work for me

  NSLog (@ "hex:% x", decimal report); // Console: "hex: 7a772f"  

As you can see that it is also not closed, any help is really appreciated!

% x prints an unsigned integer in hexadecimal representation and Sizeof (long time)! = Sizeof (unsigned) . See examples in the 64 bit transition guide.

Use the ll specifier (two lower-case L ) to get the desired output:

Previous> NSLog (@ "% lockex", Marylong);


Comments