tellp() function in C++Last Updated : 17 Mar 2025 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++ |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India