The parameter which determines which of the position pointers is affected: either the get pointer gptr or the put pointer pptr, or both.
Parameters
- pos
- New absolute position for the position pointer.
This is an object of class streampos (or traits::pos_type for other traits), which can be constructed directly from integral values representing a relative position from the beginning of the stream. - which
- Determines which of the internal position pointers shall be modified: the input pointer, the output pointer, or both. It is an object of type ios_base::openmode that for this function may take any combination of the following significant constant values:
value position pointer affected ios_base::in input position pointer ios_base::out output position pointer
Return Value
The new position value of the modified position pointer.Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
This example reads and prints 10 characters of a file starting at position 10 (characters 10th to 19th).
Basic template member declaration
( basic_streambuf<charT,traits> )| 1 2 |
|
See also
| streambuf::pubseekoff | Set internal position pointer to relative position (public member function) |
| streambuf::seekpos | Set internal position pointer to absolute position (virtual protected member function) |
