fseek
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <stdio.h> 中定义
|
||
| int fseek( FILE *stream, long offset, int origin ); |
||
设置文件指针位置,文件流的
stream指出,offset的值。然而,此功能可用于设置超出了实际的文件结束指示器,负位置值不接受. 原文:
Sets the file position indicator for the file stream
stream to the value pointed to by offset. This function can be used to set the indicator beyond the actual end of the file, however, negative position values are not accepted. 目录 |
[编辑] 参数
| stream | - | 文件流来修改
|
| offset | - | 转移到原点的相对位置的字符数
原文: number of characters to shift the position relative to origin |
| origin | - | 向哪个位置
offset被添加。它可以有以下值之一:SEEK_SET,SEEK_CUR,SEEK_END原文: position to which offset is added. It can have one of the following values: SEEK_SET, SEEK_CUR, SEEK_END |
[编辑] 返回值
0成功时,返回非零值。的流相关联的EOF标志被清除,被撤消的效果的任何ungetc.
原文:
0 upon success, nonzero value otherwise. Associated EOF flag is cleared for the stream and the effect of any ungetc is undone.
[编辑] 注释
对于文本流,唯一有效的值
offset是0(适用任何origin),先调用ftell(只适用于SEEK_SET)返回的值.原文:
For text streams, the only valid values of
offset are 0 (applicable to any origin) and a value returned by an earlier call to ftell (only applicable to SEEK_SET).[编辑] 另请参阅
| 在一个文件中的文件位置指示符移动到特定的位置 原文: moves the file position indicator to a specific location in a file (函数) | |
| 获取文件位置指示器 (函数) | |
| 返回当前的文件指针位置 原文: returns the current file position indicator (函数) | |
| 移动的文件,在一个文件中的开始位置指示器 原文: moves the file position indicator to the beginning in a file (函数) | |
| C++ documentation for fseek
| |