C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
printf Formatting Table
                                             Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
     The format for the printf family of functions is as follows:
 
          %[flags][width][.precision][prefix]type
 
    ┌──────────────────────────┬──────────────────────────────────────┐
    │ FlagsType                               │
    │ -     (left justify)     │ d,i (signed decimal)                 │
    │ +     (prefix with sign) │ u   (unsigned decimal integer)       │
    │ blank (prefix with blank)│ o   (unsigned octal integer)         │
    │ #     (modifies o,x,X,   │ x,X (unsigned hex integer)           │
    │        e,E,f,g,G)        │ f   (fixed-point float)              │
    ├──────────────────────────┤ e,E (scientific notation)            │
    │ Prefix                 │ g,G (%e or %f; whichever is shorter) │
    │ F   (far pointer)        │ c   (single character)               │
    │ N   (near pointer)       │ s   (string)                         │
    │ h   (short int)          │ p   (pointer)                        │
    │ l,L (long int or double) │ n   (character count)                │
    └──────────────────────────┴──────────────────────────────────────┘
 
     See also: Width
               Precision
               Escape Sequences
                                    -♦-