tellp() function in C++
The tellp() function returns the pointer's current "put" position in the stream when used with output streams. It has no parameters and returns a value of the member type pos_type, an integer data type that represents the put stream pointer's current position.
If successful, the current output position indication; otherwise, return -1.
the current position of pointer is :10
In the code above, the tellp() function returns the current position in the file to which it points.
Example 2 -
this is a sample
In this case, the tellp() method returns the position of the pointer. After that, the pointer is shifted back from the current place by 7 positions using the seekp() function, and the content is then inserted there.
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week