类型 | 实例 | NSLog字符 |
---|---|---|
char | 'a'、'\n' | %c |
short int | — | %hi、%hx、%ho |
unsigned short int | — | %hu、%hx、%ho |
int | 12,-99,0xFF | %i、%x、%o |
unsigned int | 12u、100U | %u、%x、%o |
long int | 12L、-20001、0xfffL | %li、%lx、%lo |
unsigned long int | 12UL、100ul、0xffeeUL | %lu、%lx、%lo |
long long int | 0xe5e5e5eLL、500ll | %lli、%llx、%llo |
unsigned long long int | 12ull、0xffeeULL | %llu、%llx、%llo |
float | 12.34f、3.1e-5f、0x1.5p10、0x1P-1 | %f、%e、%g、%a |
double | 12.44、3.1e-5、0x.lp3 | %f、%e、%g、%a |
long double | 12.34L、3.1e-5l | %Lf、%Le、%Lg |
id | nil | %p |
网友评论