fwrite.html
来自「unix 下的C开发手册,还用详细的例程。」· HTML 代码 · 共 106 行
HTML
106 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>fwrite</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_005_413"> </a>NAME</h4><blockquote>fwrite - binary output</blockquote><h4><a name = "tag_000_005_414"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="stdio.h.html">stdio.h</a>>size_t fwrite(const void *ptr, size_t <i>size</i>, size_t <i>nitems</i>, FILE *<i>stream</i>);</code></pre></blockquote><h4><a name = "tag_000_005_415"> </a>DESCRIPTION</h4><blockquote>The<i>fwrite()</i>function writes, from the array pointed to by<i>ptr</i>,up to<i>nitems</i>members whose size is specified by<i>size</i>,to the stream pointed to by<i>stream</i>.The file-position indicator for the stream (if defined) isadvanced by the number of bytes successfully written.If an error occurs, the resulting value of the file-positionindicator for the stream is indeterminate.<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>fwrite()</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_416"> </a>RETURN VALUE</h4><blockquote>The<i>fwrite()</i>function returns the number of members successfully written, which maybe less than<i>nitems</i>if a write error is encountered.If<i>size</i>or<i>nitems</i>is 0,<i>fwrite()</i>returns 0 and the state of the stream remains unchanged. Otherwise, if awrite error occurs, the error indicator for the stream is set and<i>errno</i>is set to indicate the error.</blockquote><h4><a name = "tag_000_005_417"> </a>ERRORS</h4><blockquote>Refer to<i><a href="fputc.html">fputc()</a></i>.</blockquote><h4><a name = "tag_000_005_418"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_419"> </a>APPLICATION USAGE</h4><blockquote>Because of possible differences in member length and byte ordering,files written using<i>fwrite()</i>are application-dependent, and possibly cannot be read using<i><a href="fread.html">fread()</a></i>by a different application or by the same application on a differentprocessor.</blockquote><h4><a name = "tag_000_005_420"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_421"> </a>SEE ALSO</h4><blockquote><i><a href="ferror.html">ferror()</a></i>,<i><a href="fopen.html">fopen()</a></i>,<i><a href="printf.html">printf()</a></i>,<i><a href="putc.html">putc()</a></i>,<i><a href="puts.html">puts()</a></i>,<i><a href="write.html">write()</a></i>,<i><a href="stdio.h.html"><stdio.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from Issue 1 of the SVID.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 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 + =
减小字号Ctrl + -
显示快捷键?