⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fwprintf.html

📁 IEEE 1003.1-2003, Single Unix Specification v3
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<dd>Specifies that a following <tt>d</tt> , <tt>i</tt> , <tt>o</tt> , <tt>u</tt> , <tt>x</tt> , or <tt>X</tt> conversion specifierapplies to a <b>short</b> or <b>unsigned short</b> argument (the argument will have been promoted according to the integerpromotions, but its value shall be converted to <b>short</b> or <b>unsigned short</b> before printing); or that a following<tt>n</tt> conversion specifier applies to a pointer to a <b>short</b> argument.</dd><dt><tt>l</tt>&nbsp;(ell)</dt><dd>Specifies that a following <tt>d</tt> , <tt>i</tt> , <tt>o</tt> , <tt>u</tt> , <tt>x</tt> , or <tt>X</tt> conversion specifierapplies to a <b>long</b> or <b>unsigned long</b> argument; that a following <tt>n</tt> conversion specifier applies to a pointer toa <b>long</b> argument; that a following <tt>c</tt> conversion specifier applies to a <b>wint_t</b> argument; that a following<tt>s</tt> conversion specifier applies to a pointer to a <b>wchar_t</b> argument; or has no effect on a following <tt>a</tt> ,<tt>A</tt> , <tt>e</tt> , <tt>E</tt> , <tt>f</tt> , <tt>F</tt> , <tt>g</tt> , or <tt>G</tt> conversion specifier.</dd><dt><tt>ll</tt>&nbsp;(ell-ell)</dt><dd><br>Specifies that a following <tt>d</tt> , <tt>i</tt> , <tt>o</tt> , <tt>u</tt> , <tt>x</tt> , or <tt>X</tt> conversion specifierapplies to a <b>long long</b> or <b>unsigned long long</b> argument; or that a following <tt>n</tt> conversion specifier applies toa pointer to a <b>long long</b> argument.</dd><dt><tt>j</tt></dt><dd>Specifies that a following <tt>d</tt> , <tt>i</tt> , <tt>o</tt> , <tt>u</tt> , <tt>x</tt> , or <tt>X</tt> conversion specifierapplies to an <b>intmax_t</b> or <b>uintmax_t</b> argument; or that a following <tt>n</tt> conversion specifier applies to apointer to an <b>intmax_t</b> argument.</dd><dt><tt>z</tt></dt><dd>Specifies that a following <tt>d</tt> , <tt>i</tt> , <tt>o</tt> , <tt>u</tt> , <tt>x</tt> , or <tt>X</tt> conversion specifierapplies to a <b>size_t</b> or the corresponding signed integer type argument; or that a following <tt>n</tt> conversion specifierapplies to a pointer to a signed integer type corresponding to a <b>size_t</b> argument.</dd><dt><tt>t</tt></dt><dd>Specifies that a following <tt>d</tt> , <tt>i</tt> , <tt>o</tt> , <tt>u</tt> , <tt>x</tt> , or <tt>X</tt> conversion specifierapplies to a <b>ptrdiff_t</b> or the corresponding <b>unsigned</b> type argument; or that a following <tt>n</tt> conversionspecifier applies to a pointer to a <b>ptrdiff_t</b> argument.</dd><dt><tt>L</tt></dt><dd>Specifies that a following <tt>a</tt> , <tt>A</tt> , <tt>e</tt> , <tt>E</tt> , <tt>f</tt> , <tt>F</tt> , <tt>g</tt> , or<tt>G</tt> conversion specifier applies to a <b>long double</b> argument.</dd></dl><p>If a length modifier appears with any conversion specifier other than as specified above, the behavior is undefined.</p><p>The conversion specifiers and their meanings are:</p><dl compact><dt><tt>d</tt>,&nbsp;<tt>i</tt></dt><dd>The <b>int</b> argument shall be converted to a signed decimal in the style <tt>"[-]</tt><i>dddd"</i>. The precision specifiesthe minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded withleading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no widecharacters.</dd><dt><tt>o</tt></dt><dd>The <b>unsigned</b> argument shall be converted to unsigned octal format in the style <tt>"dddd"</tt> . The precision specifiesthe minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall be expanded withleading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zero shall be no widecharacters.</dd><dt><tt>u</tt></dt><dd>The <b>unsigned</b> argument shall be converted to unsigned decimal format in the style <tt>"dddd"</tt> . The precisionspecifies the minimum number of digits to appear; if the value being converted can be represented in fewer digits, it shall beexpanded with leading zeros. The default precision shall be 1. The result of converting zero with an explicit precision of zeroshall be no wide characters.</dd><dt><tt>x</tt></dt><dd>The <b>unsigned</b> argument shall be converted to unsigned hexadecimal format in the style <tt>"dddd"</tt> ; the letters<tt>"abcdef"</tt> are used. The precision specifies the minimum number of digits to appear; if the value being converted can berepresented in fewer digits, it shall be expanded with leading zeros. The default precision shall be 1. The result of convertingzero with an explicit precision of zero shall be no wide characters.</dd><dt><tt>X</tt></dt><dd>Equivalent to the <tt>x</tt> conversion specifier, except that letters <tt>"ABCDEF"</tt> are used instead of <tt>"abcdef"</tt>.</dd><dt><tt>f</tt>,&nbsp;<tt>F</tt></dt><dd>The <b>double</b> argument shall be converted to decimal notation in the style <tt>"[-]</tt><i>ddd.ddd"</i>, where the numberof digits after the radix character shall be equal to the precision specification. If the precision is missing, it shall be takenas 6; if the precision is explicitly zero and no <tt>'#'</tt> flag is present, no radix character shall appear. If a radixcharacter appears, at least one digit shall appear before it. The value shall be rounded in an implementation-defined manner to theappropriate number of digits. <p>A <b>double</b> argument representing an infinity shall be converted in one of the styles <tt>"[-]inf"</tt> or<tt>"[-]infinity"</tt> ; which style is implementation-defined. A <b>double</b> argument representing a NaN shall be converted inone of the styles <tt>"[-]nan"</tt> or <tt>"[-]nan(</tt><i>n-char-sequence</i><tt>)"</tt>; which style, and the meaning of any<i>n-char-sequence</i>, is implementation-defined. The <tt>F</tt> conversion specifier produces <tt>"INF"</tt> ,<tt>"INFINITY"</tt> , or <tt>"NAN"</tt> instead of <tt>"inf"</tt> , <tt>"infinity"</tt> , or <tt>"nan"</tt> , respectively.</p></dd><dt><tt>e</tt>,&nbsp;<tt>E</tt></dt><dd>The <b>double</b> argument shall be converted in the style <tt>"[-]</tt><i>d.ddd</i>e<tt>&plusmn;dd"</tt>, where there shall beone digit before the radix character (which is non-zero if the argument is non-zero) and the number of digits after it shall beequal to the precision; if the precision is missing, it shall be taken as 6; if the precision is zero and no <tt>'#'</tt> flag ispresent, no radix character shall appear. The value shall be rounded in an implementation-defined manner to the appropriate numberof digits. The <tt>E</tt> conversion wide character shall produce a number with <tt>'E'</tt> instead of <tt>'e'</tt> introducingthe exponent. The exponent shall always contain at least two digits. If the value is zero, the exponent shall be zero. <p>A <b>double</b> argument representing an infinity or NaN shall be converted in the style of an <tt>f</tt> or <tt>F</tt>conversion specifier.</p></dd><dt><tt>g</tt>,&nbsp;<tt>G</tt></dt><dd>The <b>double</b> argument shall be converted in the style <tt>f</tt> or <tt>e</tt> (or in the style <tt>F</tt> or <tt>E</tt>in the case of a <tt>G</tt> conversion specifier), with the precision specifying the number of significant digits. If an explicitprecision is zero, it shall be taken as 1. The style used depends on the value converted; style <tt>e</tt> (or <tt>E</tt> ) shallbe used only if the exponent resulting from such a conversion is less than -4 or greater than or equal to the precision. Trailingzeros shall be removed from the fractional portion of the result; a radix character shall appear only if it is followed by a digit.<p>A <b>double</b> argument representing an infinity or NaN shall be converted in the style of an <tt>f</tt> or <tt>F</tt>conversion specifier.</p></dd><dt><tt>a</tt>,&nbsp;<tt>A</tt></dt><dd>A <b>double</b> argument representing a floating-point number shall be converted in the style <tt>"[-]0xh.hhhhp&plusmn;d"</tt>,where there shall be one hexadecimal digit (which is non-zero if the argument is a normalized floating-point number and isotherwise unspecified) before the decimal-point wide character and the number of hexadecimal digits after it shall be equal to theprecision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exactrepresentation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficientto distinguish values of type <b>double</b>, except that trailing zeros may be omitted; if the precision is zero and the<tt>'#'</tt> flag is not specified, no decimal-point wide character shall appear. The letters <tt>"abcdef"</tt> are used for<tt>a</tt> conversion and the letters <tt>"ABCDEF"</tt> for <tt>A</tt> conversion. The <tt>A</tt> conversion specifier produces anumber with <tt>'X'</tt> and <tt>'P'</tt> instead of <tt>'x'</tt> and <tt>'p'</tt> . The exponent shall always contain at least onedigit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shallbe zero. <p>A <b>double</b> argument representing an infinity or NaN shall be converted in the style of an <tt>f</tt> or <tt>F</tt>conversion specifier.</p></dd><dt><tt>c</tt></dt><dd>If no <tt>l</tt> (ell) qualifier is present, the <b>int</b> argument shall be converted to a wide character as if by callingthe <a href="../functions/btowc.html"><i>btowc</i>()</a> function and the resulting wide character shall be written. Otherwise, the<b>wint_t</b> argument shall be converted to <b>wchar_t</b>, and written.</dd><dt><tt>s</tt></dt><dd>If no <tt>l</tt> (ell) qualifier is present, the application shall ensure that the argument is a pointer to a character arraycontaining a character sequence beginning in the initial shift state. Characters from the array shall be converted as if byrepeated calls to the <a href="../functions/mbrtowc.html"><i>mbrtowc</i>()</a> function, with the conversion state described by an<b>mbstate_t</b> object initialized to zero before the first character is converted, and written up to (but not including) theterminating null wide character. If the precision is specified, no more than that many wide characters shall be written. If theprecision is not specified, or is greater than the size of the array, the application shall ensure that the array contains a nullwide character. <p>If an <tt>l</tt> (ell) qualifier is present, the application shall ensure that the argument is a pointer to an array of type<b>wchar_t</b>. Wide characters from the array shall be written up to (but not including) a terminating null wide character. If noprecision is specified, or is greater than the size of the array, the application shall ensure that the array contains a null widecharacter. If a precision is specified, no more than that many wide characters shall be written.</p></dd><dt><tt>p</tt></dt><dd>The application shall ensure that the argument is a pointer to <b>void</b>. The value of the pointer shall be converted to asequence of printable wide characters in an implementation-defined manner.</dd><dt><tt>n</tt></dt><dd>The application shall ensure that the argument is a pointer to an integer into which is written the number of wide characterswritten to the output so far by this call to one of the <i>fwprintf</i>() functions. No argument shall be converted, but one shallbe consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined.</dd><dt><tt>C</tt></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Equivalent to <tt>lc</tt> . <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt><tt>S</tt></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Equivalent to <tt>ls</tt> . <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt><tt>%</tt></dt><dd>Output a <tt>'%'</tt> wide character; no argument shall be converted. The entire conversion specification shall be <tt>%%</tt>.</dd></dl><p>If a conversion specification does not match one of the above forms, the behavior is undefined.</p><p>In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion is wider than thefield width, the field shall be expanded to contain the conversion result. Characters generated by <i>fwprintf</i>() and

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -