Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在这里我有一个
int x=3; NSLog(@"%i", x);
如何让它显示为“01”?如果 x=12 让它显示为“12”?谢谢
怎么样"%02d"?
"%02d"
还是"%02i"?
"%02i"
(有关格式化信息或cocoadev NSLOG ,请参见 man printf )