fpos::operator streamoff

Cast object of type fpos to object of type streamoff.

operator streamoff( ) const;

Remarks

The member function returns the stored offset member object and any additional offset stored as part of the fpos_t member object.

Example

// 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

Requirements

Header: <ios>

Namespace: std

See Also

Reference

fpos Class

iostream Programming

iostreams Conventions

Other Resources

fpos Members