Summary of output format characters in IOS

Source: Internet
Author: User

/****
% U table shows the unsigned type
Int output format: % I, % d, % o % x
Float output format: % F, % E, % G
Double Output Format: % F, % E, % G
Char output format character: % C
Long output format character: % L
Long int output format character: % Li
Long Double Output Format character: % lf
Long long output format character: long INT: % llI
Short output format: Short INT: % Hi
**/

# Import <Foundation/Foundation. h>

Int int main (INT argc, char const * argv [])
{
Int year = 2013;
Nslog (@ "this year is % d Year \ n", year );
Nslog (@ "argc = % d \ n", argc );

Int I = 100;
Float F = 1.1;
Double D = 2.2;
Short int Si = 200;
Long long int LL = 12342342434234234213421l;
Char c = 'C ';
Bool B = true;
Bool BL = true;

Nslog (@ "I = % d size = % u Byte", I, sizeof (I ));
Nslog (@ "F = % F size = % u Byte", F, sizeof (f ));
Nslog (@ "d = % E size = % u Byte", D, sizeof (d ));
Nslog (@ "Si = % d size = % u Byte", Si, sizeof (SI ));
Nslog (@ "LL = % llI size = % u Byte", ll, sizeof (LL ));
Nslog (@ "c = % C size = % u Byte", C, sizeof (c ));
Nslog (@ "B = % d size = % u Byte", B, sizeof (B ));

Nslog (@ "I = % d size = % u Byte", I, sizeof (I ));

Return 0;
}

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.