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::strstream::pcount(3) C++ Standard Libary std::strstream::pcount(3)

std::strstream::pcount - std::strstream::pcount


int pcount() const;


Returns the number of characters that were output in the put area of the associated
std::strstreambuf. Effectively calls rdbuf()->pcount()


(none)


The number of characters in the put area, or zero if nothing was output.

// Run this code


#include <strstream>
#include <iostream>


int main()
{
std::strstream dyn; // dynamically-allocated output buffer
dyn << "Test: " << 1.23 << std::ends;
std::cout << "The size of the output is " << dyn.pcount()
<< " and it holds \"" << dyn.str() << "\"\n";
dyn.freeze(false);


char buf[10];
std::strstream user(buf, 10); // user-provided output buffer
user << 1.23; // note: no std::ends
std::cout.write(buf, user.pcount());
std::cout << '\n';
}


The size of the output is 11 and it holds "Test: 1.23"
1.23


returns the next pointer minus the beginning pointer in the output sequence:
pcount the number of characters written
(public member function of std::strstreambuf)

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.