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►
────────────────────────────────────────────────────────────────────────────
The format for the printf family of functions is as follows:
% flags width .precision type prefix format type
┌──────────────────────────┬──────────────────────────────────────┐
│ Flags │ Format Type │
│ - (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) │
│ Type 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: ◄Escape Sequences►
-♦-