본문 바로가기
프로그래밍

Objective-C Types : NSLog Formats

by 밝음의기둥 2014. 5. 13.
반응형

Objective-C Types : NSLog Formats

 

 Type

 Constant Examples

 NSLog Format

 char

 'a', '\n'

 %c

 short int

 

 %hi, %hx, %ho

 unsigned short int

 

 %hu, %hx, %ho

 int

 17, -99, 0xFFAE, 0878

 %i, %x, %o

 unsigned int

 17u, 101U, OXFFu

 %u, %x, %o

 long int

 17L, -2998, OxffffL

 %li, %lx, %lo

 unsigned long int

 17UL, -100ul, OxffeeUL

 %li, %lx, %lo

 long long int

 0xe5e5e5e5LL, 500ll

 %lli, %llx, %llo

 unsigned long long int

 17ull, oxffefULL

 %llu, %llx, %llo

 float

 12.3f, 3.1e-5f, 0×1.5p10, 0×1P-1

 %f, %e, %g, %a

 double

 12.34, 3.1e-5, 0×.1p3

 %f, %e, %g, %a

 long double

 12.34l, 3.1e-5l

 %Lf, %Le, %Lg

 id

 nil

 %p

 

반응형