首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::fsetpos

Defined in header <cstdio>

?

?

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在失败的时候。

注记

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

另见

fgetpos

gets the file position indicator (function)

ftell

returns the current file position indicator (function)

fseek

moves the file position indicator to a specific location in a file (function)

C.Fsetpos文件

代码语言:txt
复制
 ? cppreference.com

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com