fseek.html

来自「从www.CppReference.com打包的C++参考手册」· HTML 代码 · 共 89 行

HTML
89
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>  <meta name="generator" content=  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org">  <title>fseek</title>  <link href="../cppreference.css" rel="stylesheet" type="text/css"></head><body><table>  <tr>  <td>  <div class="body-content">  <div class="header-box">    <a href="../index.html">cppreference.com</a> &gt; <a href=    "index.html">Standard C I/O</a> &gt; <a href="fseek.html">fseek</a>  </div>  <div class="name-format">    fseek  </div>  <div class="syntax-name-format">    Syntax:  </div>  <pre class="syntax-box">  #include &lt;stdio.h&gt;  int fseek( FILE *stream, long offset, int origin );</pre>  <p>The function fseek() sets the file position data for the given  <em>stream</em>. The origin value should have one of the following  values (defined in stdio.h):</p>  <table class="code-table">    <tr>      <th class="code-table-th">Name</th>      <th class="code-table-th">Explanation</th>    </tr>    <tr>      <td class="code-table-td">SEEK_SET</td>      <td class="code-table-td">Seek from the start of the file</td>    </tr>    <tr>      <td class="code-table-td">SEEK_CUR</td>      <td class="code-table-td">Seek from the current location</td>    </tr>    <tr>      <td class="code-table-td">SEEK_END</td>      <td class="code-table-td">Seek from the end of the file</td>    </tr>  </table>  <p>fseek() returns zero upon success, non-zero on failure. You can  use fseek() to move beyond a file, but not before the beginning.  Using fseek() clears the <strong>EOF</strong> flag associated with  that stream.</p>  <div class="related-name-format">    Related topics:  </div>  <div class="related-content">    <a href="fgetpos.html">fgetpos</a><br>    <a href="fopen.html">fopen</a><br>    <a href="fsetpos.html">fsetpos</a><br>    <a href="ftell.html">ftell</a><br>    <a href="rewind.html">rewind</a>  </div>  </div>  </td>    </tr>  </table></body></html>

⌨️ 快捷键说明

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