문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top