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

📄 fputc.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>fputc</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_005_194">&nbsp;</a>NAME</h4><blockquote>fputc - put a byte on a stream</blockquote><h4><a name = "tag_000_005_195">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>#include &lt;<a href="stdio.h.html">stdio.h</a>&gt;int fputc(int <i>c</i>, FILE *<i>stream</i>);</code></pre></blockquote><h4><a name = "tag_000_005_196">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>fputc()</i>function writes the byte specified by<i>c</i>(converted to an<b>unsigned char</b>)to the output stream pointed to by<i>stream</i>,at the position indicated by the associated file-positionindicator for the stream (if defined), and advances the indicatorappropriately.If the file cannot support positioning requests, or if the streamwas opened with append mode, the byte is appended to theoutput stream.<p>The<i>st_ctime</i>and<i>st_mtime</i>fields of the file will be marked for update between the successfulexecution of<i>fputc()</i>and the next successful completion of a call to<i><a href="fflush.html">fflush()</a></i>or<i><a href="fclose.html">fclose()</a></i>on the same stream or a call to<i><a href="exit.html">exit()</a></i>or<i><a href="abort.html">abort()</a></i>.</blockquote><h4><a name = "tag_000_005_197">&nbsp;</a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>fputc()</i>returns the value it has written.  Otherwise, itreturns EOF,the error indicator for thestream is set, and<i>errno</i>is set to indicate the error.</blockquote><h4><a name = "tag_000_005_198">&nbsp;</a>ERRORS</h4><blockquote>The<i>fputc()</i>function will fail if either the<i>stream</i>is unbuffered or the<i>stream</i>'sbuffer needs to be flushed, and:<dl compact><dt>[EAGAIN]<dd>The O_NONBLOCK flag is set for the file descriptorunderlying<i>stream</i>and the process would be delayed in the write operation.<dt>[EBADF]<dd>The file descriptor underlying<i>stream</i>is not a valid file descriptor open for writing.<dt>[EFBIG]<dd>An attempt was made to write to a file that exceedsthe maximum file size&nbsp;or the process' file size limit.<dt>[EFBIG]<dd>The file is a regular file and an attempt was made to write at or beyond the offset maximum.<dt>[EINTR]<dd>The write operation was terminated due to thereceipt of a signal, and no data was transferred.<dt>[EIO]<dd>A physical I/O error has occurred, or&nbsp;the process is a memberof a background process group attempting to write to itscontrolling terminal, TOSTOP is set, the process is neither ignoring norblocking SIGTTOU and the process group of the process isorphaned.This error may also be returned under implementation-dependent conditions.<dt>[ENOSPC]<dd>There was no free space remaining on the device containingthe file.<dt>[EPIPE]<dd>An attempt is made to write to a pipe or FIFO that is not openfor reading by any process.A SIGPIPE signal will also be sent to the thread.</dl><p>The<i>fputc()</i>function may fail if:<dl compact><dt>[ENOMEM]<dd>Insufficient storage space is available.<dt>[ENXIO]<dd>A request was made of a non-existent device, or the request wasoutside the capabilities of the device.</dl></blockquote><h4><a name = "tag_000_005_199">&nbsp;</a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_200">&nbsp;</a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_201">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_202">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="ferror.html">ferror()</a></i>,<i><a href="fopen.html">fopen()</a></i>,<i><a href="getrlimit.html">getrlimit()</a></i>,<i><a href="putc.html">putc()</a></i>,<i><a href="puts.html">puts()</a></i>,<i><a href="setbuf.html">setbuf()</a></i>,<i><a href="ulimit.html">ulimit()</a></i>,<i><a href="stdio.h.html">&lt;stdio.h&gt;</a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from Issue 1 of the SVID.</blockquote><hr size=2 noshade><center><font size=2>UNIX &reg; is a registered Trademark of The Open Group.<br>Copyright &copy; 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>

⌨️ 快捷键说明

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