The put pointer determines the location in the output sequence where the next output operation is going to take place.
Parameters
noneReturn Value
An integral value of type streampos with the number of characters between the beginning of the output sequence and the current position.Failure is indicated by returning a value of -1.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
In this example, tellp is used to get the position of the put pointer after the writing operation. The pointer is then moved back 7 characters to modify the file at that position, so the final content of the file shall be:
This is a sample
Basic template member declaration
(basic_ostream<charT,traits>)| 1 2 |
|
See also
| istream::seekg | Set position of the get pointer (public member function) |
| ostream::tellp | Get position of put pointer (public member function) |
