转换类型 fpos 对象设置为 streamoff类型的对象。
operator streamoff( ) const;
备注
成员函数返回存储的偏移成员对象和任何附加偏移量存储 fpos_t 作为对象成员的一部分。
示例
// fpos_op_streampos.cpp
// compile with: /EHsc
#include <ios>
#include <iostream>
#include <fstream>
int main( )
{
using namespace std;
streamoff s;
ofstream file( "rdbuf.txt");
fpos<mbstate_t> f = file.tellp( );
// Is equivalent to ..
// streampos f = file.tellp( );
s = f;
cout << s << endl;
}
0
要求
页眉: <ios>
命名空间: std