随机读写API

rewind:复位文件指针流

  void rewind(FILE *stream)

       

ftell:返回文件流指针距离文件首部的字节数

  long ftell(FILE *stream)

       

fseek:文件流指针定位

  int fseek(FILE *stream, long offset, int whence)

    whence:起始位置

      文件开头,SEEK_SET 0

      文件当前位置 SEEK_CUR 1

      文件末尾 SEEK_END 2

    offset: 流指针的偏移量(如果为正数,向右偏移,单位为字节数),为负数就向左偏移

 

 

 

posted @ 2023-03-17 17:12  牙齿凤  阅读(34)  评论(0)    收藏  举报