tellp() function in C++Introduction: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. Syntax:Return -If successful, the current output position indication; otherwise, return -1. Example:1Output: the current position of pointer is :10 Explanation: In the code above, the tellp() function returns the current position in the file to which it points. Example 2 -Output: this is a sample Explanation: 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.
Next TopicMatrix addition in C++
|
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