
06-14-2008, 11:32 PM
|
|
Programming Expert
|
|
Join Date: Mar 2008
Posts: 371
Credits: 0
Rep Power: 7
|
|
Re: a problem in C pre specifire
The C89 Draft
Quote:
An optional decimal integer specifying a minimum field width. If the converted value has fewer characters than the field width, it will be padded with spaces on the left (or right, if the left adjustment flag, described later, has been given) to the field width.
An optional precision that gives the minimum number of digits to appear for the d , i , o , u , x , and X conversions, the number of digits to appear after the decimal-point character for e , E , and f conversions, the maximum number of significant digits for the g and G conversions, or the maximum number of characters to be written from a string in s conversion. The precision takes the form of a period (.) followed by an optional decimal integer; if the integer is omitted, it is treated as zero.
[...]
A field width or precision, or both, may be indicated by an asterisk * instead of a digit string. In this case, an int argument supplies the field width or precision. The arguments specifying field width or precision, or both, shall appear (in that order) before the argument (if any) to be converted. A negative field width argument is taken as a - flag followed by a positive field width. A negative precision argument is taken as if it were missing.
|
Last edited by dcs; 06-14-2008 at 11:34 PM.
|