GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::basic_ostream::tellp(3) C++ Standard Libary std::basic_ostream::tellp(3)

std::basic_ostream::tellp - std::basic_ostream::tellp


pos_type tellp();


Returns the output position indicator of the current associated streambuf object.


Behaves as UnformattedOutputFunction (except without actually (since C++11)
performing output). After constructing and checking the sentry object,


If fail()==true, returns pos_type(-1). Otherwise, returns rdbuf()->pubseekoff(0,
std::ios_base::cur, std::ios_base::out).


(none)


current output position indicator on success, pos_type(-1) if a failure occurs.

// Run this code


#include <iostream>
#include <sstream>
int main()
{
std::ostringstream s;
std::cout << s.tellp() << '\n';
s << 'h';
std::cout << s.tellp() << '\n';
s << "ello, world ";
std::cout << s.tellp() << '\n';
s << 3.14 << '\n';
std::cout << s.tellp() << '\n' << s.str();
}


0
1
13
18
hello, world 3.14


seekp sets the output position indicator
(public member function)
tellg returns the input position indicator
(public member function of std::basic_istream<CharT,Traits>)
seekg sets the input position indicator
(public member function of std::basic_istream<CharT,Traits>)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.