glib-string-utility-functions.html
来自「glid编写实例」· HTML 代码 · 共 1,304 行 · 第 1/5 页
HTML
1,304 行
</table></div></div><hr><div class="refsect2" lang="en"><a name="id2940888"></a><h3><a name="g-printf"></a>g_printf ()</h3><a class="indexterm" name="id2940898"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a> g_printf (<a href="glib-Basic-Types.html#gchar">gchar</a> const *format, ...);</pre><p>An implementation of the standard <code class="function">printf()</code> function which supports positional parameters, as specified in the Single Unix Specification.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>format</code></em> :</span></td><td> a standard <code class="function">printf()</code> format string, but notice <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>...</code></em> :</span></td><td> the arguments to insert in the output.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.</td></tr></tbody></table></div><p>Since 2.2</p></div><hr><div class="refsect2" lang="en"><a name="id2941008"></a><h3><a name="g-vprintf"></a>g_vprintf ()</h3><a class="indexterm" name="id2941019"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a> g_vprintf (<a href="glib-Basic-Types.html#gchar">gchar</a> const *format, va_list args);</pre><p>An implementation of the standard <code class="function">vprintf()</code> function which supports positional parameters, as specified in the Single Unix Specification.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>format</code></em> :</span></td><td> a standard <code class="function">printf()</code> format string, but notice <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>args</code></em> :</span></td><td> the list of arguments to insert in the output.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.</td></tr></tbody></table></div><p>Since 2.2</p></div><hr><div class="refsect2" lang="en"><a name="id2941138"></a><h3><a name="g-fprintf"></a>g_fprintf ()</h3><a class="indexterm" name="id2941148"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a> g_fprintf (FILE *file, <a href="glib-Basic-Types.html#gchar">gchar</a> const *format, ...);</pre><p>An implementation of the standard <code class="function">fprintf()</code> function which supports positional parameters, as specified in the Single Unix Specification.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>file</code></em> :</span></td><td> the stream to write to.</td></tr><tr><td><span class="term"><em class="parameter"><code>format</code></em> :</span></td><td> a standard <code class="function">printf()</code> format string, but notice <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>...</code></em> :</span></td><td> the arguments to insert in the output.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.</td></tr></tbody></table></div><p>Since 2.2</p></div><hr><div class="refsect2" lang="en"><a name="id2941281"></a><h3><a name="g-vfprintf"></a>g_vfprintf ()</h3><a class="indexterm" name="id2941291"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a> g_vfprintf (FILE *file, <a href="glib-Basic-Types.html#gchar">gchar</a> const *format, va_list args);</pre><p>An implementation of the standard <code class="function">fprintf()</code> function which supports positional parameters, as specified in the Single Unix Specification.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>file</code></em> :</span></td><td> the stream to write to.</td></tr><tr><td><span class="term"><em class="parameter"><code>format</code></em> :</span></td><td> a standard <code class="function">printf()</code> format string, but notice <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>args</code></em> :</span></td><td> the list of arguments to insert in the output.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.</td></tr></tbody></table></div><p>Since 2.2</p></div><hr><div class="refsect2" lang="en"><a name="id2941431"></a><h3><a name="g-sprintf"></a>g_sprintf ()</h3><a class="indexterm" name="id2941441"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a> g_sprintf (<a href="glib-Basic-Types.html#gchar">gchar</a> *string, <a href="glib-Basic-Types.html#gchar">gchar</a> const *format, ...);</pre><p>An implementation of the standard <code class="function">sprintf()</code> function which supports positional parameters, as specified in the Single Unix Specification.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>string</code></em> :</span></td><td> the buffer to hold the output.</td></tr><tr><td><span class="term"><em class="parameter"><code>format</code></em> :</span></td><td> a standard <code class="function">printf()</code> format string, but notice <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>...</code></em> :</span></td><td> the arguments to insert in the output.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the number of characters printed.</td></tr></tbody></table></div><p>Since 2.2</p></div><hr><div class="refsect2" lang="en"><a name="id2941573"></a><h3><a name="g-vsprintf"></a>g_vsprintf ()</h3><a class="indexterm" name="id2941583"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gint">gint</a> g_vsprintf (<a href="glib-Basic-Types.html#gchar">gchar</a> *string, <a href="glib-Basic-Types.html#gchar">gchar</a> const *format, va_list args);</pre><p>An implementation of the standard <code class="function">vsprintf()</code> function which supports positional parameters, as specified in the Single Unix Specification.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>string</code></em> :</span></td><td> the buffer to hold the output.</td></tr><tr><td><span class="term"><em class="parameter"><code>format</code></em> :</span></td><td> a standard <code class="function">printf()</code> format string, but notice <a href="glib-String-Utility-Functions.html#string-precision">string precision pitfalls</a>.</td></tr><tr><td><span class="term"><em class="parameter"><code>args</code></em> :</span></td><td> the list of arguments to insert in the output.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?