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

📄 fsetpos.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
字号:
.func fsetpos
#include <stdio.h>
int fsetpos( FILE *fp, fpos_t *pos );
.ixfunc2 '&StrIo' &func
.funcend
.desc begin
The &func function positions the file
.arg fp
according to the value of the object pointed to by
.arg pos,
which shall be a value returned by an earlier call to the
.kw fgetpos
function on the same file.
.desc end
.return begin
The &func function returns zero if successful, otherwise, the
&func function returns a non-zero value.
.im errnoref
.return end
.see begin
.seelist fsetpos fgetpos fopen fseek ftell
.see end
.exmp begin
#include <stdio.h>

void main()
  {
    FILE *fp;
    fpos_t position;
    auto char buffer[80];
.exmp break
    fp = fopen( "file", "r" );
    if( fp != NULL ) {
      fgetpos( fp, &position ); /* get position     */
      fgets( buffer, 80, fp );  /* read record      */
      fsetpos( fp, &position ); /* set position     */
      fgets( buffer, 80, fp );  /* read same record */
      fclose( fp );
    }
  }
.exmp end
.class ANSI
.system

⌨️ 快捷键说明

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