Question

NSLog function accepts printf format specifiers. My question is about %x specifier. Does this print hex codes as sequence on memory? Or does it have it's own printing sequence style?

unsigned int a = 0x000000FF;
NSLog(@"%x", a);

Results of above code on little or big endian processors are equal or different? And how about NSString's -initWithFormat method? Does it follows this rule equally?

Was it helpful?

Solution

%x always prints the most significant digits first. Doesn't matter what kind of processor it is running on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top