Objective-C format output

Source: Internet
Author: User
% @ Object
% d,% i integer
% u unsigned integer
% f floating point / doubleword
% x,% X binary integer
% o octal integer
% zu size_t
% p pointer
% e floating point / doubleword (scientific calculation)
% g floating point / double word
% s C string
%. * s Pascal string
% c character
% C unichar
% lld 64-bit long integer (long long)
% llu unsigned 64-bit long integer
% Lf 64-bit double word
% e is a real number, calculated using scientific notation

Format character Description
% a a floating point value (only valid for C99)
% A Same as above
% c one character
% d decimal integer
% i decimal, octal, hexadecimal integer
% o octal integer
% x hexadecimal integer
% X Same as above
% c one character
% s A string that ends with a space, tab, or newline.
% f Real number, which can be entered in decimal or exponential form.
% F Same as above
% e Same as above
% E Same as above
% g as above
% G as above
% p a pointer
% u an unsigned decimal integer
% [] Scan character set
%%% symbol

Type NSlog characters
char% c
short% hi,% hx,% ho
unsigned short% hu,% hx,% ho
int% i,% x,% o
unsigned% u,% x,% o
long% li,% lx,% lo
unsigned long% lu,% lx,% lo
long long% lli,% llx,% llo
unsigned long long% llu,% llx,% llo
float% f,% e,% g,% a
double% f,% e,% g,% a
long double% Lf,% Le,% Lg
id% p 




From: http://www.cnblogs.com/jackbutler/archive/2012/04/05/2432828.html


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.