C Pocket Reference by Peter Prinz & Ulla Kirch-Prinz

C Pocket Reference by Peter Prinz & Ulla Kirch-Prinz

Author:Peter Prinz & Ulla Kirch-Prinz [Peter Prinz]
Language: eng
Format: epub, pdf
Tags: COMPUTERS / Programming Languages / C
ISBN: 9780596103965
Publisher: O'Reilly Media
Published: 2009-06-29T04:00:00+00:00


' ' (space)

A leading space is prefixed to positive numbers.

-

The output is left-justified in the field.

0

The field is filled with leading zeroes to the left of the number.

#

Alternate conversion rules are used as follows: If specifier is A (*), a (*), E, e, G, or g, floating-point numbers are formatted with a decimal point. If specifier is X, x, or o, hexadecimal integers are formatted with the 0X or 0x prefix, and octal integers with the 0 prefix.

The field width is a positive integer that fixes the length of the field occupied by the given conversion specification in the output string. If the flags include a minus sign, the converted value appears left-justified in the field; otherwise, it is right-justified. The excess field length is filled with space characters. If the output string is longer than the field width, the field width is increased as necessary to print the string in its entirety.

An asterisk (*) may also be specified for the field width. In this case, the field width is determined by an additional argument of type int, which immediately precedes the argument to be converted in the argument list.

.precision determines the number of decimal places printed in the output of floating-point numbers, when specifier is f or e. If specifier is g, .precision determines the number of significant digits. Rounding is performed if necessary. For floating-point numbers, the default value for .precision is 6.

For integers , .precision indicates the minimum number of digits to be printed. Leading zeroes are prefixed as necessary. For integers, the default value for .precision is 1.

If the argument to be converted is a string, then .precision indicates the maximum number of characters of the string that should appear.

specifier is the conversion specifier, indicating how the given argument is to be interpreted and converted. Note that specifier must correspond to the actual type of the argument to be converted. The possible conversion specifiers are listed in Table 1-24.

Table 1-24. Conversion specifiers for formatted output

Specifier

Argument types

Output format



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.