C++
输入/输出 | Input/output

std::fsetpos

STD::fsetpos

Defined in header
int fsetpos( std::FILE* stream, const std::fpos_t* pos

为C文件流设置文件位置指示符和多字节解析状态%28(如果有%29)stream根据所指的值pos...

除了建立新的解析状态和位置之外,对此函数的调用还会取消std::ungetc并清除文件结束状态(如果设置了的话)。

如果发生读或写错误,则错误指示符%28std::ferror为流设置%29。

参数

stream-file stream to modify
pos-pointer to a fpos_t object obtained from std::fgetpos called on a stream associated with the same file

返回值

​0​如果成功,则非零值。另外,集合errno在失败的时候。

注记

在寻找宽流中的非结束位置之后,对任何输出函数的下一次调用可能会使文件的其余部分未定义,例如,通过输出不同长度的多字节序列。

另见

fgetposgets the file position indicator (function)
ftellreturns the current file position indicator (function)
fseekmoves the file position indicator to a specific location in a file (function)

C.Fsetpos文件

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/io/c/fsetpos