美文网首页
格式化输出

格式化输出

作者: Lifeasy | 来源:发表于2016-04-13 00:11 被阅读22次
八进制格式化输出
NSLog(@"%o",15);
NSLog(@"%#o",15)

输出
2016-04-12 23:36:14.093 MyTest[43037:539029] 17
2016-04-12 23:36:14.094 MyTest[43037:539029] 017

十六进制格式化输出
NSLog(@"%x",15);
NSLog(@"%#x",15);

输出
2016-04-12 23:36:14.094 MyTest[43037:539029] f
2016-04-12 23:36:14.094 MyTest[43037:539029] 0xf

相关文章

网友评论

      本文标题:格式化输出

      本文链接:https://www.haomeiwen.com/subject/emuwlttx.html