C language printf format output detailed

Source: Internet
Author: User
Conversion description and printout as result%a floating-point, hexadecimal-digit, and P-notation (C99)
%A floating-point numbers, hexadecimal digits, and P-notation (C99)
%c one character
%d signed decimal integers
%e floating-point number, E-notation method
%E floating-point number, E-notation method
%f floating-point number and decimal notation method
%g automatically selects%f or%e depending on the value.
%G automatically selects%f or%e depending on the value.
%i Signed decimal number (same as%d)
%o unsigned octal integer
%p pointer
%s string
%u unsigned decimal integer
%x uses a hexadecimal digit of 0f unsigned hexadecimal integer
%x uses a hexadecimal digit of 0f unsigned hexadecimal integer
Print a percent percent

There is also a special format%*.*, where the values of the two asterisks are specified by the values of the second and third parameters, printf ("%.*s \ n", 8, "ABCDEFGGGGGG");
printf ("%*.*f \ n", 3,3, 1.25456f);

C language printf format output detailed

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.