大家好,又见面了,我是你们的朋友全栈君。
seekg()是对输入流的操作 g是get缩写
seekp()是对输出流的操作 p是put缩写
seekg()
Moves the read position in a stream.//移动在流中读的位置
------------------------------------------------------------------------
basic_istream<Elem, Tr>& seekg( //一个参数
pos_type pos
);
basic_istream<Elem, Tr>& seekg(
off_type off, //两个参数
ios_base::seekdir way
);
------------------------------------------------------------------------
参数
pos
The absolute position in which to move the read pointer.
//移动读取指针的绝对位置
off //偏移量
An offset to move the read pointer relative to way.
way // 基地址
One of the ios_base::seekdir enumerations.
它有三个取值
ios::beg:表示输入流的开始位置
ios::cur:表示输入流的当前位置
ios::end:表示输入流的结束位置
输出结果:
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/130506.html原文链接:https://javaforall.net