FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    PrintF output format

     

    The PrintF function is called a format output function, and the last letter f is the meaning of "format). Its function is to display the specified data on the display screen by the format specified by the user. General form of Printf function call The Printf function is a standard library function, its function prototype in the header file "stdio.h". However, as a special case, the stdio.h file must be included before using the Printf function. The general form of the PrintF function call is: Printf ("Format Control String", Output Table Layer) Be The format control string is used to specify the output format. Format control strings can be composed of two format strings and non-format strings. The format string is a string that starts with%, with a variety of format characters in%, to illustrate the type, form, length, and lower number of output data. like: "% D" means it is output according to the decimal output; "% Ld" means output according to the decimal output; "% C" indicates that the output is output, etc. Non-format string slave output, prompts in display. Each output item is given in the output list, requiring the format string and each output item to correspond to the number and type. Format string 1) Type Type characters to indicate the type of output data, its formatting characters and me functions as shown in the following table: Format Characters D outputs a symbol integer (positive number does not output symbol) O Output unsigned integers in octal form (no output prefix 0) X, x output unsigned integers in hexadecimal form (no output prefix ox) U Output unsigned integers in decimal form F In decimal form, double accuracy E, E output a single, double precision implement in the index form G, g with a shorter output width output single, double precision real number in% f or% e C Output a single character S output string 2) Sign The logo character is -, +, # and space four, its meaning shown in the table: flag meaning - Results left aligned, right edges + Output symbol (positive or negative) The space output value is positive and the crown is spaced, and the crown is negative. # 有 有 有 类, 类; For the O class, prefix O; For the X class, add 0x when output; The decimal point is given when e, g, and fang is decimal. 3) Output minimum width Use a decimal integer to indicate the minimum number of outputs. If the actual number of digits is more than the defined width, then the actual number of digits is output, and if the actual number of digits is less than the defined width, the space or 0 is supplied. 4) accuracy The accuracy format begins with ".", Followed by the decimal integer. The meaning of this is: If the number is output, the number of digits is indicated; if the output is the character, the number of output characters is indicated; if the actual number of digits is greater than the defined accuracy, the exceeding portion is cut. 5) length The length format is H, L, H indicates that the shorter amount output is output, and L is indicated by the long output. #Include "stdio.h" #Include "string.h" Int main () { CHAR C, S [20]; INT A = 1234; Float f = 3.141592653589; Double x = 0.12345678912345678; STRCPY (S, "Hello, World"); C = '\ x41'; Printf ("a =% D \ n", a); // output according to the decimal integer format, display a = 1234 Printf ("A =% D %% \ n", a); // output% number result A = 1234% Printf ("a =% 6d \ n", a); // output 6-digit decimal integer left filling, display a = 1234 Printf ("a =% 06d \ n", a); // output 6-digit decimal integer left to supplement 0, display a = 001234 Printf ("a =% 2D \ n", a); // a more than 2 digits, press actual output a = 1234 Printf ("a =% - 6d \ n", a); /// output 6-digit 10-input integer to the right side, display a = 1234 Printf ("f =% f \ n", f); // floating point effective number is 7 bits, result f = 3.141593 Printf ("f = 6.4f \ n", f); // output 6 columns, 4 digits after decimal point, result f = 3.1416 Printf ("x =% lf \ n", x); // output long floating point number x = 0.123457 Printf ("x =% 18.16LF \ n", x); // output 18 columns, 16 digits after decimal point, x = 0.1234567891234567 Printf ("C =% C \ n", c); // Output Character C = a Printf ("c =% x \ n", c); // ASCII code c = 41 with hexadecimal output characters Printf ("s [] =% s \ n", s); // Output array string s [] = Hello, World Printf ("s [] =% 6.9s \ n", s); // outputs up to 9 characters String s [] = Hello, Wor Return 0; }, Technology area MYBATIS Dynamic SQL Detailed Design the HDB3 encoder in the data transmission system with VHDL language How does the bare metal program drive hardware? What is the seniors say? Typical examples of object-oriented programming SOC principles Introduction to Java Common Development Tools for Embedded Development

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us