std::strstream::pcount (3) - Linux Man Pages
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()
The number of characters in the put area, or zero if nothing was output.
// Run this code
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";
std::strstream user(buf, 10); // user-provided output buffer
user << 1.23; // note: no std::ends
std::cout << '\n';
The size of the output is 11 and it holds "Test: 1.23"
returns the next pointer minus the beginning pointer in the output sequence: the number of characters written
pcount (public member function of std::strstreambuf)