iOS print various types of data

Placeholder integer Description: 

% D: decimal integer, unsigned positive, negative, the "-" symbol; 

% O: Octal unsigned integers, the prefix is ​​not 0; 

% X: hexadecimal unsigned integer, no prefix 0x; 

% U: unsigned decimal integer;

% Hd: short integer

% Ld,% lld: long integer

 

% Zd: Signed NSInteger dedicated output, it should be borne in mind in iOS development.

% Tu: unsigned output of NSUInteger

% Lu: sizeof (i) the number of bytes of memory occupied

 

Character placeholder Description: 

% C: output a single character; 

% S: output string;

 

Placeholder for floating point instructions: 

% F: output a decimal floating-point number, the default 6 decimal places; 

% E: floating output exponentially, default 6 decimal places; 

% G: automatically selecting% f% e, or all kinds;

 

Other forms placeholders: 

% P: output pointer address in hexadecimal notation; 

% @: Object Object-C output;

 

Additional character placeholders: 

- l: integer and floating point prior Placeholder,% d% o% x% u% f% e% g Long and representatives long string; 

- n (arbitrary integer):% 8d represents an output 8-bit digital output total number of bits; 

- .n: Decimal floating-point limit,% 5.2f 2 represents a 5-digit decimal number string interception of characters; 

- -: Characters Left;

 

 

Transfer: https: //www.jianshu.com/p/efc8770007d8

Guess you like

Origin www.cnblogs.com/yang-shuai/p/11980784.html