大家好,又见面了,我是你们的朋友全栈君。
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.cn/130506.html原文链接:https://javaforall.cn