strstreambuf::pcount
Returns a count of the number of elements written to the controlled sequence.
streamsize pcount( ) const;
반환 값
A count of the number of elements written to the controlled sequence.
설명
Specifically, if pptr is a null pointer, the function returns zero. Otherwise, it returns pptr – pbase.
예제
// strstreambuf_pcount.cpp
// compile with: /EHsc
#include <iostream>
#include <strstream>
using namespace std;
int main( )
{
strstream x;
x << "test1";
cout << x.rdbuf( )->pcount( ) << endl;
x << "test2";
cout << x.rdbuf( )->pcount( ) << endl;
}
Output
5
10
요구 사항
Header: <strstream>
네임스페이스: std