使用示例:
1 CCLOG("Characters: %c %c", 'a', 65); 2 CCLOG("Decimals: %d %ld", 1977, 650000L); 3 CCLOG("Preceding with blanks: %10d", 1977); 4 CCLOG("Preceding with zeros: %010d", 1977); 5 CCLOG("Some different radixes: %d %x %o %#x %#o", 100, 100, 100, 100, 100); 6 CCLOG("Floats: %4.2f %.0e %E", 3.1416, 3.1416, 3.1416); 7 CCLOG("%s","A string");
输出:
1 cocos2d: Characters: a A 2 cocos2d: Decimals: 1977 650000 3 cocos2d: Preceding with blanks: 1977 4 cocos2d: Preceding with zeros: 0000001977 5 cocos2d: Some different radixes: 100 64 144 0x64 0144 6 cocos2d: Floats: 3.14 3e+00 3.141600E+00 7 cocos2d: A string